Babel firewall
This commit is contained in:
parent
e4b4115b9a
commit
b0520ddc2c
|
@ -380,6 +380,7 @@ BATMAN_IPV6=
|
||||||
|
|
||||||
# Babel mesh
|
# Babel mesh
|
||||||
ENABLE_BABEL="no"
|
ENABLE_BABEL="no"
|
||||||
|
BABEL_PORT=6696
|
||||||
|
|
||||||
# social key management
|
# social key management
|
||||||
ENABLE_SOCIAL_KEY_MANAGEMENT="no"
|
ENABLE_SOCIAL_KEY_MANAGEMENT="no"
|
||||||
|
@ -1582,17 +1583,19 @@ function mesh_babel {
|
||||||
if [[ $ENABLE_BABEL != "yes" ]]; then
|
if [[ $ENABLE_BABEL != "yes" ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
apt-get -y install babeld
|
apt-get -y install babeld avahi-utils avahi-autoipd
|
||||||
|
|
||||||
numarray=( 1 2 3 4 5 6 7 8 9 0 )
|
numarray=( 1 2 3 4 5 6 7 8 9 0 )
|
||||||
a=${numarray[$RANDOM%10]}${numarray[$RANDOM%10]}
|
a=${numarray[$RANDOM%10]}${numarray[$RANDOM%10]}
|
||||||
b=${numarray[$RANDOM%10]}${numarray[$RANDOM%10]}
|
b=${numarray[$RANDOM%10]}${numarray[$RANDOM%10]}
|
||||||
echo '#!/bin/sh' > /usr/bin/mesh-babel
|
echo '#!/bin/sh' > /usr/bin/mesh-babel
|
||||||
echo 'systemctl stop networking' >> /usr/bin/mesh-babel
|
echo 'systemctl stop networking' >> /usr/bin/mesh-babel
|
||||||
|
echo 'ifconfig wlan0 down' >> /usr/bin/mesh-babel
|
||||||
echo 'iwconfig wlan0 mode ad-hoc channel 11 essid “mesh"' >> /usr/bin/mesh-babel
|
echo 'iwconfig wlan0 mode ad-hoc channel 11 essid “mesh"' >> /usr/bin/mesh-babel
|
||||||
echo 'ifconfig wlan0 up' >> /usr/bin/mesh-babel
|
echo 'ifconfig wlan0 up' >> /usr/bin/mesh-babel
|
||||||
echo "ifconfig wlan0 192.168.$a.$b netmask 255.255.255.0 broadcast 192.168.13.255" >> /usr/bin/mesh-babel
|
echo 'avahi-autoipd wlan0' >> /usr/bin/mesh-babel
|
||||||
echo 'babeld -d 5 wlan0' >> /usr/bin/mesh-babel
|
echo "ifconfig wlan0:avahi 192.168.$a.$b netmask 255.255.255.0 broadcast 192.168.13.255" >> /usr/bin/mesh-babel
|
||||||
|
echo "babeld -D wlan0:avahi -p $BABEL_PORT -d 5 wlan0" >> /usr/bin/mesh-babel
|
||||||
echo 'exit 0' >> /usr/bin/mesh-babel
|
echo 'exit 0' >> /usr/bin/mesh-babel
|
||||||
|
|
||||||
echo 'mesh_babel' >> $COMPLETION_FILE
|
echo 'mesh_babel' >> $COMPLETION_FILE
|
||||||
|
@ -5521,9 +5524,8 @@ function configure_firewall_for_babel {
|
||||||
if [[ $ENABLE_BABEL != "yes" ]]; then
|
if [[ $ENABLE_BABEL != "yes" ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
# DHCP
|
iptables -A INPUT -i wlan0 -p udp --dport $BABEL_PORT -j ACCEPT
|
||||||
#iptables -A INPUT -i eth0 -p udp --dport 547 -j ACCEPT
|
save_firewall_settings
|
||||||
#save_firewall_settings
|
|
||||||
echo 'configure_firewall_for_babel' >> $COMPLETION_FILE
|
echo 'configure_firewall_for_babel' >> $COMPLETION_FILE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue