forked from freifunk-franken/firmware
Rework network config
- remove obsolete crontabs - move mac handling to network.sh - update wr741xx, wr740 and wr1043 to new network config Signed-off-by: Tim Niemeyer <tim.niemeyer@mastersword.de>
This commit is contained in:
parent
32403e49a3
commit
25d1a19624
|
@ -1,5 +1,5 @@
|
|||
|
||||
machine=wr741nd2
|
||||
machine=wr741
|
||||
target=$builddir/$machine
|
||||
|
||||
board_prepare() {
|
||||
|
@ -12,6 +12,7 @@ board_prebuild() {
|
|||
|
||||
board_postbuild() {
|
||||
cp $target/bin/ar71xx/openwrt-ar71xx-generic-tl-wr741nd-v2-squashfs-*.bin ./bin/
|
||||
cp $target/bin/ar71xx/openwrt-ar71xx-generic-tl-wr741nd-v4-squashfs-*.bin ./bin/
|
||||
}
|
||||
|
||||
board_flash() {
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
machine=wr741nd4
|
||||
target=$builddir/$machine
|
||||
|
||||
board_prepare() {
|
||||
echo "nothing todo" > /dev/null
|
||||
}
|
||||
|
||||
board_prebuild() {
|
||||
echo "nothing todo" > /dev/null
|
||||
}
|
||||
|
||||
board_postbuild() {
|
||||
cp $target/bin/ar71xx/openwrt-ar71xx-generic-tl-wr741nd-v4-squashfs-*.bin ./bin/
|
||||
}
|
||||
|
||||
board_flash() {
|
||||
echo "nothing implemented"
|
||||
}
|
||||
|
||||
board_clean() {
|
||||
/bin/rm -rf $target bin/*$machine*
|
||||
}
|
||||
|
|
@ -1,36 +1,27 @@
|
|||
config 'interface' 'loopback'
|
||||
option 'ifname' 'lo'
|
||||
option 'proto' 'static'
|
||||
option 'ipaddr' '127.0.0.1'
|
||||
option 'netmask' '255.0.0.0'
|
||||
config interface 'loopback'
|
||||
option ifname 'lo'
|
||||
option proto 'static'
|
||||
option ipaddr '127.0.0.1'
|
||||
option netmask '255.0.0.0'
|
||||
|
||||
#config 'interface' 'lan'
|
||||
# option 'proto' 'dhcp'
|
||||
# option 'ifname' 'eth0.1'
|
||||
config interface 'wlanmesh'
|
||||
option mtu '1532'
|
||||
option proto 'batadv'
|
||||
option mesh 'bat0'
|
||||
|
||||
config 'interface' 'wlanmesh'
|
||||
option 'mtu' '1528'
|
||||
|
||||
config 'interface' 'mesh'
|
||||
option 'type' 'bridge'
|
||||
option 'ifname' 'eth0.1 bat0 tap0'
|
||||
option 'auto' '1'
|
||||
|
||||
config 'switch' 'eth0'
|
||||
option 'name' 'eth0'
|
||||
option 'reset' '1'
|
||||
option 'enable_vlan' '1'
|
||||
|
||||
config 'switch_vlan' 'eth0_1'
|
||||
option 'device' 'eth0'
|
||||
option 'vlan' '1'
|
||||
option 'ports' '0 1 2 3 5t'
|
||||
|
||||
config 'switch_vlan' 'eth0_2'
|
||||
option 'device' 'eth0'
|
||||
option 'vlan' '2'
|
||||
option 'ports' '4 5t'
|
||||
|
||||
config 'interface' 'wan'
|
||||
option 'ifname' 'eth0.2'
|
||||
option 'proto' 'dhcp'
|
||||
config interface 'mesh'
|
||||
option type 'bridge'
|
||||
option auto '1'
|
||||
|
||||
config interface 'wan'
|
||||
option proto 'dhcp'
|
||||
option ifname 'eth1'
|
||||
|
||||
config interface 'ethmesh'
|
||||
option mtu '1532'
|
||||
option proto 'batadv'
|
||||
option mesh 'bat0'
|
||||
|
||||
config interface 'bat'
|
||||
option ifname 'bat0'
|
||||
option mtu '1500'
|
||||
|
|
|
@ -6,4 +6,3 @@ config 'script'
|
|||
|
||||
config 'network'
|
||||
option 'mesh_interface' 'br-mesh'
|
||||
option 'client_interfaces' 'ath0 wlan0 eth0.1'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
*/5 * * * * sh /etc/fastdstart.sh; sh /etc/nodewatcher.sh; sh /etc/configurator.sh; sh /etc/statistics.sh
|
||||
*/5 * * * * sh /etc/fastdstart.sh; sh /etc/nodewatcher.sh; sh /etc/configurator.sh; sh /etc/statistics.sh; sh /etc/wlanwatchdog.sh >> /var/log/wlanwatchdog.log 2>&1
|
||||
|
||||
#15 01 * * * rdate -s time.fu-berlin.de > /dev/null
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
if ! uci get nodewatcher.@network[0].client_interfaces; then
|
||||
echo "Setting nodewatchers client interfaces to: $CLIENTIF"
|
||||
uci set nodewatcher.@network[0].client_interfaces="$CLIENTIF"
|
||||
uci commit
|
||||
fi
|
||||
|
||||
if ! uci get network.$SWITCHDEV.ifname; then
|
||||
uci set network.$SWITCHDEV=switch
|
||||
|
@ -47,3 +52,35 @@ if ! uci get network.$SWITCHDEV.ifname; then
|
|||
uci commit
|
||||
/etc/init.d/network reload
|
||||
fi
|
||||
|
||||
if [[ -n "$ETHMESHMAC" ]]; then
|
||||
if uci get network.ethmesh.macaddr
|
||||
then
|
||||
echo "MAC for ethmesh is set already"
|
||||
else
|
||||
echo "Fixing MAC on eth0.3 (ethmesh)"
|
||||
NEW_MACADDR=$(cat /sys/class/net/$ETHMESHMAC/address)
|
||||
uci set network.ethmesh.macaddr=$NEW_MACADDR
|
||||
uci commit
|
||||
ifconfig eth0.3 down
|
||||
ifconfig eth0.3 hw ether $NEW_MACADDR
|
||||
ifconfig eth0.3 up
|
||||
/etc/init.d/network reload
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -n "$ROUTERMAC" ]]; then
|
||||
if uci get network.mesh.macaddr
|
||||
then
|
||||
echo "MAC for mesh is set already"
|
||||
else
|
||||
echo "Fixing MAC on br-mesh (mesh)"
|
||||
NEW_MACADDR=$(cat /sys/class/net/$ROUTERMAC/address)
|
||||
uci set network.mesh.macaddr=$NEW_MACADDR
|
||||
uci commit
|
||||
ifconfig br-mesh down
|
||||
ifconfig br-mesh hw ether $NEW_MACADDR
|
||||
ifconfig br-mesh up
|
||||
/etc/init.d/network reload
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -2,6 +2,14 @@
|
|||
# the system init finished. By default this file does nothing.
|
||||
|
||||
BOARD=$(cat /var/sysinfo/board_name)
|
||||
case "$BOARD" in
|
||||
tl-wr1043nd)
|
||||
BOARD=tl-wr1043nd-v1
|
||||
;;
|
||||
tl-wr741nd)
|
||||
grep "Atheros AR7240 rev 2" /proc/cpuinfo && BOARD=tl-wr741nd-v2 || BOARD=tl-wr741nd-v4
|
||||
;;
|
||||
esac
|
||||
if ! uci get board.model.name; then
|
||||
uci set board.model.name=BOARD
|
||||
fi
|
||||
|
@ -10,8 +18,6 @@ fi
|
|||
|
||||
. /etc/network.sh
|
||||
|
||||
. /etc/rc.local.$BOARD
|
||||
|
||||
# collect environment info and write to dot-script
|
||||
/etc/environment.sh > /tmp/environment
|
||||
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
*/5 * * * * sh /etc/fastdstart.sh; sh /etc/nodewatcher.sh; sh /etc/configurator.sh; sh /etc/statistics.sh; sh /etc/wlanwatchdog.sh >> /var/log/wlanwatchdog.log 2>&1
|
||||
|
||||
#15 01 * * * rdate -s time.fu-berlin.de > /dev/null
|
||||
|
||||
#Enable zapp script if you are running a gateway
|
||||
#*/1 * * * * /etc/init.d/zapp
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
*/5 * * * * sh /etc/fastdstart.sh; sh /etc/nodewatcher.sh; sh /etc/configurator.sh; sh /etc/statistics.sh; sh /etc/wlanwatchdog.sh >> /var/log/wlanwatchdog.log 2>&1
|
||||
|
||||
#15 01 * * * rdate -s time.fu-berlin.de > /dev/null
|
||||
|
||||
#Enable zapp script if you are running a gateway
|
||||
#*/1 * * * * /etc/init.d/zapp
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
config model 'model'
|
||||
option name 'wr1043nd-v1'
|
|
@ -1,47 +0,0 @@
|
|||
config 'interface' 'loopback'
|
||||
option 'ifname' 'lo'
|
||||
option 'proto' 'static'
|
||||
option 'ipaddr' '127.0.0.1'
|
||||
option 'netmask' '255.0.0.0'
|
||||
|
||||
config 'interface' 'wlanmesh'
|
||||
option 'ifname' 'wlan1'
|
||||
option 'mtu' '1528'
|
||||
|
||||
config 'interface' 'mesh'
|
||||
option 'type' 'bridge'
|
||||
option 'ifname' 'eth0.1 wlan0 bat0 tap0'
|
||||
option 'auto' '1'
|
||||
|
||||
config 'interface' 'wan'
|
||||
option 'ifname' 'eth0.2'
|
||||
option 'proto' 'dhcp'
|
||||
|
||||
config 'interface' 'ethmesh'
|
||||
option 'ifname' 'eth0.3'
|
||||
option 'mtu' '1528'
|
||||
|
||||
config 'switch'
|
||||
option 'name' 'rtl8366rb'
|
||||
option 'reset' '1'
|
||||
option 'enable_vlan' '1'
|
||||
|
||||
#3. und 4. LAN Port
|
||||
config 'switch_vlan'
|
||||
option 'device' 'rtl8366rb'
|
||||
option 'vlan' '1'
|
||||
option 'ports' '3 4 5t'
|
||||
|
||||
#WAN
|
||||
config 'switch_vlan'
|
||||
option 'device' 'rtl8366rb'
|
||||
option 'vlan' '2'
|
||||
option 'ports' '0 5t'
|
||||
|
||||
|
||||
#1. und 2. LAN Port
|
||||
config 'switch_vlan'
|
||||
option 'device' 'rtl8366rb'
|
||||
option 'vlan' '3'
|
||||
option 'ports' '1 2 5t'
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
*/5 * * * * sh /etc/fastdstart.sh; sh /etc/nodewatcher.sh; sh /etc/configurator.sh; sh /etc/statistics.sh; sh /etc/wlanwatchdog.sh >> /var/log/wlanwatchdog.log 2>&1
|
||||
|
||||
#15 01 * * * rdate -s time.fu-berlin.de > /dev/null
|
||||
|
||||
#Enable zapp script if you are running a gateway
|
||||
#*/1 * * * * /etc/init.d/zapp
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
WANDEV=eth0
|
||||
SWITCHDEV=eth0
|
||||
CLIENT_PORTS="3 4 5t"
|
||||
WAN_PORTS="0 5t"
|
||||
BATMAN_PORTS="1 2 5t"
|
||||
|
||||
CLIENTIF="eth0.1 wlan0"
|
||||
ETHMESHMAC=
|
||||
ROUTERMAC=
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
batctl if add wlan0-1
|
||||
batctl if add eth0.3
|
|
@ -1,2 +0,0 @@
|
|||
config model 'model'
|
||||
option name 'wr740n-v4'
|
|
@ -1,40 +0,0 @@
|
|||
|
||||
config 'interface' 'loopback'
|
||||
option 'ifname' 'lo'
|
||||
option 'proto' 'static'
|
||||
option 'ipaddr' '127.0.0.1'
|
||||
option 'netmask' '255.0.0.0'
|
||||
|
||||
config 'interface' 'wlanmesh'
|
||||
option 'ifname' 'wlan1'
|
||||
option 'mtu' '1528'
|
||||
|
||||
config 'interface' 'mesh'
|
||||
option 'type' 'bridge'
|
||||
option 'ifname' 'eth0.1 wlan0 bat0 tap0'
|
||||
option 'auto' '1'
|
||||
|
||||
config 'interface' 'wan'
|
||||
option 'ifname' 'eth1'
|
||||
option 'proto' 'dhcp'
|
||||
|
||||
config 'interface' 'ethmesh'
|
||||
option 'ifname' 'eth0.3'
|
||||
option 'mtu' '1528'
|
||||
|
||||
config 'switch'
|
||||
option 'name' 'eth0'
|
||||
option 'reset' '1'
|
||||
option 'enable_vlan' '1'
|
||||
|
||||
#3. und 4. LAN Port
|
||||
config 'switch_vlan'
|
||||
option 'device' 'eth0'
|
||||
option 'vlan' '1'
|
||||
option 'ports' '1 4 0t'
|
||||
|
||||
#1. und 2. LAN Port
|
||||
config 'switch_vlan'
|
||||
option 'device' 'eth0'
|
||||
option 'vlan' '3'
|
||||
option 'ports' '2 3 0t'
|
|
@ -11,10 +11,9 @@ config led 'status_led'
|
|||
option sysfs 'tp-link:green:system'
|
||||
option trigger 'heartbeat'
|
||||
|
||||
|
||||
config led 'led_vpn'
|
||||
option name 'VPN'
|
||||
option sysfs 'tp-link:green:qss'
|
||||
option trigger 'netdev'
|
||||
option dev 'ffhbVPN'
|
||||
option dev '${VPN_PROJECT}VPN'
|
||||
option mode 'link'
|
|
@ -1,7 +0,0 @@
|
|||
*/5 * * * * sh /etc/fastdstart.sh; sh /etc/nodewatcher.sh; sh /etc/configurator.sh; sh /etc/statistics.sh; sh /etc/wlanwatchdog.sh >> /var/log/wlanwatchdog.log 2>&1
|
||||
|
||||
#15 01 * * * rdate -s time.fu-berlin.de > /dev/null
|
||||
|
||||
#Enable zapp script if you are running a gateway
|
||||
#*/1 * * * * /etc/init.d/zapp
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
WANDEV=eth1
|
||||
# WANDEV=eth0
|
||||
SWITCHDEV=eth0
|
||||
CLIENT_PORTS="1 4 0t"
|
||||
WAN_PORTS=
|
||||
BATMAN_PORTS="2 3 0t"
|
||||
|
||||
CLIENTIF="eth0.1 wlan0-1"
|
||||
ETHMESHMAC=eth1
|
||||
ROUTERMAC=wlan0
|
|
@ -1,29 +0,0 @@
|
|||
|
||||
#Set Mac-Addr of wr1043nd wifi interface if not right
|
||||
WLAN0_MACADDR=$(cat /sys/class/net/wlan0/address)
|
||||
BRMESH_MACADDR=$(cat /sys/class/net/br-mesh/address)
|
||||
|
||||
if [[ "$WLAN0_MACADDR=" != "$BRMESH_MACADDR=" ]]; then
|
||||
echo "Fixing wrong MAC on br-mesh"
|
||||
uci set network.mesh.macaddr=$WLAN0_MACADDR
|
||||
uci commit
|
||||
ifconfig br-mesh hw ether $WLAN0_MACADDR
|
||||
ifconfig br-mesh down
|
||||
ifconfig br-mesh up
|
||||
fi
|
||||
|
||||
if uci get network.ethmesh.macaddr
|
||||
then
|
||||
echo "MAC for ETH-BATMAN is set already"
|
||||
else
|
||||
echo "Fixing MAC on eth0.3 (ethmesh)"
|
||||
NEW=$(awk -F: '{ printf("%02x:%02x:%02x:%02x:%02x:%02x\n", ("0x"$1)+2, "0x"$2, "0x"$3, "0x"$4, "0x"$5, "0x"$6 ) }' /sys/class/net/eth0/address)
|
||||
uci set network.ethmesh.macaddr=$NEW
|
||||
uci commit
|
||||
ifconfig eth0.3 hw ether $NEW
|
||||
ifconfig eth0.3 down
|
||||
ifconfig eth0.3 up
|
||||
fi
|
||||
|
||||
batctl if add wlan0-1
|
||||
batctl if add eth0.3
|
|
@ -15,5 +15,5 @@ config led 'led_vpn'
|
|||
option name 'VPN'
|
||||
option sysfs 'tp-link:green:qss'
|
||||
option trigger 'netdev'
|
||||
option dev 'ffhbVPN'
|
||||
option dev '${VPN_PROJECT}VPN'
|
||||
option mode 'link'
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
WANDEV=eth1
|
||||
# WANDEV=eth0
|
||||
SWITCHDEV=eth0
|
||||
CLIENT_PORTS="1 2 0t"
|
||||
WAN_PORTS=
|
||||
BATMAN_PORTS="3 4 0t"
|
||||
|
||||
CLIENTIF="eth0.1 wlan0-1"
|
||||
ETHMESHMAC=eth1
|
||||
ROUTERMAC=wlan0
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
WANDEV=eth1
|
||||
# WANDEV=eth0
|
||||
SWITCHDEV=eth0
|
||||
CLIENT_PORTS="1 4 0t"
|
||||
WAN_PORTS=
|
||||
BATMAN_PORTS="2 3 0t"
|
||||
|
||||
CLIENTIF="eth0.1 wlan0-1"
|
||||
ETHMESHMAC=eth1
|
||||
ROUTERMAC=wlan0
|
|
@ -1,2 +0,0 @@
|
|||
config model 'model'
|
||||
option name 'tl-wr741nd-v2'
|
|
@ -1,41 +0,0 @@
|
|||
|
||||
config 'interface' 'loopback'
|
||||
option 'ifname' 'lo'
|
||||
option 'proto' 'static'
|
||||
option 'ipaddr' '127.0.0.1'
|
||||
option 'netmask' '255.0.0.0'
|
||||
|
||||
config 'interface' 'wlanmesh'
|
||||
option 'ifname' 'wlan1'
|
||||
option 'mtu' '1528'
|
||||
|
||||
config 'interface' 'mesh'
|
||||
option 'type' 'bridge'
|
||||
option 'ifname' 'eth0.1 wlan0 bat0 tap0'
|
||||
option 'auto' '1'
|
||||
|
||||
config 'interface' 'wan'
|
||||
option 'ifname' 'eth1'
|
||||
option 'proto' 'dhcp'
|
||||
|
||||
config 'interface' 'ethmesh'
|
||||
option 'ifname' 'eth0.3'
|
||||
option 'mtu' '1528'
|
||||
|
||||
config 'switch'
|
||||
option 'name' 'eth0'
|
||||
option 'reset' '1'
|
||||
option 'enable_vlan' '1'
|
||||
|
||||
#3. und 4. LAN Port
|
||||
config 'switch_vlan'
|
||||
option 'device' 'eth0'
|
||||
option 'vlan' '1'
|
||||
option 'ports' '1 2 0t'
|
||||
|
||||
#1. und 2. LAN Port
|
||||
config 'switch_vlan'
|
||||
option 'device' 'eth0'
|
||||
option 'vlan' '3'
|
||||
option 'ports' '4 3 0t'
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
|
||||
config system
|
||||
option hostname 'OpenWrt'
|
||||
option timezone 'CET-1CEST,M3.5.0,M10.5.0/3'
|
||||
|
||||
config rdate
|
||||
option interface 'wan'
|
||||
|
||||
config led 'status_led'
|
||||
option name 'status'
|
||||
option sysfs 'tp-link:green:system'
|
||||
option trigger 'heartbeat'
|
||||
|
||||
|
||||
config led 'led_vpn'
|
||||
option name 'VPN'
|
||||
option sysfs 'tp-link:green:qss'
|
||||
option trigger 'netdev'
|
||||
option dev 'ffhbVPN'
|
||||
option mode 'link'
|
|
@ -1,7 +0,0 @@
|
|||
*/5 * * * * sh /etc/fastdstart.sh; sh /etc/nodewatcher.sh; sh /etc/configurator.sh; sh /etc/statistics.sh; sh /etc/wlanwatchdog.sh >> /var/log/wlanwatchdog.log 2>&1
|
||||
|
||||
#15 01 * * * rdate -s time.fu-berlin.de > /dev/null
|
||||
|
||||
#Enable zapp script if you are running a gateway
|
||||
#*/1 * * * * /etc/init.d/zapp
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
|
||||
#Set Mac-Addr of wr1043nd wifi interface if not right
|
||||
WLAN0_MACADDR=$(cat /sys/class/net/wlan0/address)
|
||||
BRMESH_MACADDR=$(cat /sys/class/net/br-mesh/address)
|
||||
|
||||
if [[ "$WLAN0_MACADDR=" != "$BRMESH_MACADDR=" ]]; then
|
||||
echo "Fixing wrong MAC on br-mesh"
|
||||
uci set network.mesh.macaddr=$WLAN0_MACADDR
|
||||
uci commit
|
||||
ifconfig br-mesh hw ether $WLAN0_MACADDR
|
||||
ifconfig br-mesh down
|
||||
ifconfig br-mesh up
|
||||
fi
|
||||
|
||||
if uci get network.ethmesh.macaddr
|
||||
then
|
||||
echo "MAC for ETH-BATMAN is set already"
|
||||
else
|
||||
echo "Fixing MAC on eth0.3 (ethmesh)"
|
||||
NEW=$(awk -F: '{ printf("%02x:%02x:%02x:%02x:%02x:%02x\n", ("0x"$1)+2, "0x"$2, "0x"$3, "0x"$4, "0x"$5, "0x"$6 ) }' /sys/class/net/eth0/address)
|
||||
uci set network.ethmesh.macaddr=$NEW
|
||||
uci commit
|
||||
ifconfig eth0.3 hw ether $NEW
|
||||
ifconfig eth0.3 down
|
||||
ifconfig eth0.3 up
|
||||
fi
|
||||
|
||||
batctl if add wlan0-1
|
||||
batctl if add eth0.3
|
||||
|
1965
bsp/wr741nd4/.config
1965
bsp/wr741nd4/.config
File diff suppressed because it is too large
Load Diff
|
@ -1,2 +0,0 @@
|
|||
config model 'model'
|
||||
option name 'tl-wr741nd-v4'
|
|
@ -1,40 +0,0 @@
|
|||
|
||||
config 'interface' 'loopback'
|
||||
option 'ifname' 'lo'
|
||||
option 'proto' 'static'
|
||||
option 'ipaddr' '127.0.0.1'
|
||||
option 'netmask' '255.0.0.0'
|
||||
|
||||
config 'interface' 'wlanmesh'
|
||||
option 'ifname' 'wlan1'
|
||||
option 'mtu' '1528'
|
||||
|
||||
config 'interface' 'mesh'
|
||||
option 'type' 'bridge'
|
||||
option 'ifname' 'eth0.1 wlan0 bat0 tap0'
|
||||
option 'auto' '1'
|
||||
|
||||
config 'interface' 'wan'
|
||||
option 'ifname' 'eth1'
|
||||
option 'proto' 'dhcp'
|
||||
|
||||
config 'interface' 'ethmesh'
|
||||
option 'ifname' 'eth0.3'
|
||||
option 'mtu' '1528'
|
||||
|
||||
config 'switch'
|
||||
option 'name' 'eth0'
|
||||
option 'reset' '1'
|
||||
option 'enable_vlan' '1'
|
||||
|
||||
#3. und 4. LAN Port
|
||||
config 'switch_vlan'
|
||||
option 'device' 'eth0'
|
||||
option 'vlan' '1'
|
||||
option 'ports' '1 4 0t'
|
||||
|
||||
#1. und 2. LAN Port
|
||||
config 'switch_vlan'
|
||||
option 'device' 'eth0'
|
||||
option 'vlan' '3'
|
||||
option 'ports' '2 3 0t'
|
|
@ -1,7 +0,0 @@
|
|||
*/5 * * * * sh /etc/fastdstart.sh; sh /etc/nodewatcher.sh; sh /etc/configurator.sh; sh /etc/statistics.sh; sh /etc/wlanwatchdog.sh >> /var/log/wlanwatchdog.log 2>&1
|
||||
|
||||
#15 01 * * * rdate -s time.fu-berlin.de > /dev/null
|
||||
|
||||
#Enable zapp script if you are running a gateway
|
||||
#*/1 * * * * /etc/init.d/zapp
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
|
||||
#Set Mac-Addr of wr1043nd wifi interface if not right
|
||||
WLAN0_MACADDR=$(cat /sys/class/net/wlan0/address)
|
||||
BRMESH_MACADDR=$(cat /sys/class/net/br-mesh/address)
|
||||
|
||||
if [[ "$WLAN0_MACADDR=" != "$BRMESH_MACADDR=" ]]; then
|
||||
echo "Fixing wrong MAC on br-mesh"
|
||||
uci set network.mesh.macaddr=$WLAN0_MACADDR
|
||||
uci commit
|
||||
ifconfig br-mesh hw ether $WLAN0_MACADDR
|
||||
ifconfig br-mesh down
|
||||
ifconfig br-mesh up
|
||||
fi
|
||||
|
||||
if uci get network.ethmesh.macaddr
|
||||
then
|
||||
echo "MAC for ETH-BATMAN is set already"
|
||||
else
|
||||
echo "Fixing MAC on eth0.3 (ethmesh)"
|
||||
NEW=$(awk -F: '{ printf("%02x:%02x:%02x:%02x:%02x:%02x\n", ("0x"$1)+2, "0x"$2, "0x"$3, "0x"$4, "0x"$5, "0x"$6 ) }' /sys/class/net/eth0/address)
|
||||
uci set network.ethmesh.macaddr=$NEW
|
||||
uci commit
|
||||
ifconfig eth0.3 hw ether $NEW
|
||||
ifconfig eth0.3 down
|
||||
ifconfig eth0.3 up
|
||||
fi
|
||||
|
||||
batctl if add wlan0-1
|
||||
batctl if add eth0.3
|
|
@ -1,27 +0,0 @@
|
|||
config interface 'loopback'
|
||||
option ifname 'lo'
|
||||
option proto 'static'
|
||||
option ipaddr '127.0.0.1'
|
||||
option netmask '255.0.0.0'
|
||||
|
||||
config interface 'wlanmesh'
|
||||
option mtu '1532'
|
||||
option proto 'batadv'
|
||||
option mesh 'bat0'
|
||||
|
||||
config interface 'mesh'
|
||||
option type 'bridge'
|
||||
option auto '1'
|
||||
|
||||
config interface 'wan'
|
||||
option proto 'dhcp'
|
||||
option ifname 'eth1'
|
||||
|
||||
config interface 'ethmesh'
|
||||
option mtu '1532'
|
||||
option proto 'batadv'
|
||||
option mesh 'bat0'
|
||||
|
||||
config interface 'bat'
|
||||
option ifname 'bat0'
|
||||
option mtu '1500'
|
|
@ -1,45 +0,0 @@
|
|||
config interface 'loopback'
|
||||
option ifname 'lo'
|
||||
option proto 'static'
|
||||
option ipaddr '127.0.0.1'
|
||||
option netmask '255.0.0.0'
|
||||
|
||||
config interface 'wlanmesh'
|
||||
option mtu '1532'
|
||||
option proto 'batadv'
|
||||
option mesh 'bat0'
|
||||
|
||||
config interface 'mesh'
|
||||
option type 'bridge'
|
||||
option ifname 'eth0.1 bat0 tap0'
|
||||
option auto '1'
|
||||
|
||||
config interface 'wan'
|
||||
option ifname 'eth1'
|
||||
option proto 'dhcp'
|
||||
|
||||
config interface 'ethmesh'
|
||||
option ifname 'eth0.3'
|
||||
option mtu '1532'
|
||||
option proto 'batadv'
|
||||
option mesh 'bat0'
|
||||
|
||||
config interface 'bat'
|
||||
option ifname 'bat0'
|
||||
option mtu '1500'
|
||||
|
||||
config switch 'eth0'
|
||||
option enable '1'
|
||||
option reset '1'
|
||||
option enable_vlan '1'
|
||||
|
||||
config switch_vlan 'eth0_1'
|
||||
option device 'eth0'
|
||||
option vlan '1'
|
||||
option ports '1 2 0t'
|
||||
|
||||
config switch_vlan 'eth0_3'
|
||||
option device 'eth0'
|
||||
option vlan '3'
|
||||
option ports '3 4 0t'
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
config 'script'
|
||||
option 'version' '25'
|
||||
option 'error_level' '0'
|
||||
option 'logfile' '/var/log/nodewatcher.log'
|
||||
option 'data_file' '/tmp/crawldata/node.data'
|
||||
|
||||
config 'network'
|
||||
option 'mesh_interface' 'br-mesh'
|
|
@ -1,7 +0,0 @@
|
|||
*/5 * * * * sh /etc/fastdstart.sh; sh /etc/nodewatcher.sh; sh /etc/configurator.sh; sh /etc/statistics.sh; sh /etc/wlanwatchdog.sh >> /var/log/wlanwatchdog.log 2>&1
|
||||
|
||||
#15 01 * * * rdate -s time.fu-berlin.de > /dev/null
|
||||
|
||||
#Enable zapp script if you are running a gateway
|
||||
#*/1 * * * * /etc/init.d/zapp
|
||||
|
|
@ -5,3 +5,7 @@ SWITCHDEV=eth1
|
|||
CLIENT_PORTS="1 4 0t"
|
||||
WAN_PORTS=
|
||||
BATMAN_PORTS="3 2 0t"
|
||||
|
||||
CLIENTIF="eth1.1 wlan0-1"
|
||||
ETHMESHMAC=eth0
|
||||
ROUTERMAC=wlan0
|
||||
|
|
|
@ -5,3 +5,7 @@ SWITCHDEV=eth0
|
|||
CLIENT_PORTS="1 2 0t"
|
||||
WAN_PORTS=
|
||||
BATMAN_PORTS="3 4 0t"
|
||||
|
||||
CLIENTIF="eth0.1 wlan0-1"
|
||||
ETHMESHMAC=eth1
|
||||
ROUTERMAC=eth0
|
||||
|
|
|
@ -5,3 +5,7 @@ SWITCHDEV=eth0
|
|||
CLIENT_PORTS="1 2 0t"
|
||||
WAN_PORTS=
|
||||
BATMAN_PORTS="3 4 0t"
|
||||
|
||||
CLIENTIF="eth0.1 wlan0-1"
|
||||
ETHMESHMAC=eth1
|
||||
ROUTERMAC=wlan0
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
|
||||
if ! uci get nodewatcher.@network[0].client_interfaces; then
|
||||
IF="eth1.1 wlan0-1"
|
||||
echo "Setting nodewatchers client interfaces to: $IF"
|
||||
uci set nodewatcher.@network[0].client_interfaces="$IF"
|
||||
uci commit
|
||||
fi
|
||||
|
||||
if uci get network.ethmesh.macaddr
|
||||
then
|
||||
echo "MAC for ethmesh is set already"
|
||||
else
|
||||
echo "Fixing MAC on eth1.3 (ethmesh)"
|
||||
NEW_MACADDR=$(cat /sys/class/net/eth0/address)
|
||||
uci set network.ethmesh.macaddr=$NEW_MACADDR
|
||||
uci commit
|
||||
ifconfig eth1.3 down
|
||||
ifconfig eth1.3 hw ether $NEW_MACADDR
|
||||
ifconfig eth1.3 up
|
||||
/etc/init.d/network reload
|
||||
fi
|
||||
|
||||
if uci get network.mesh.macaddr
|
||||
then
|
||||
echo "MAC for mesh is set already"
|
||||
else
|
||||
echo "Fixing MAC on br-mesh (mesh)"
|
||||
NEW_MACADDR=$(cat /sys/class/net/wlan0/address)
|
||||
uci set network.mesh.macaddr=$NEW_MACADDR
|
||||
uci commit
|
||||
ifconfig br-mesh down
|
||||
ifconfig br-mesh hw ether $NEW_MACADDR
|
||||
ifconfig br-mesh up
|
||||
/etc/init.d/network reload
|
||||
fi
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
|
||||
if ! uci get nodewatcher.@network[0].client_interfaces; then
|
||||
IF="eth0.1 wlan0-1"
|
||||
echo "Setting nodewatchers client interfaces to: $IF"
|
||||
uci set nodewatcher.@network[0].client_interfaces="$IF"
|
||||
uci commit
|
||||
fi
|
||||
|
||||
if uci get network.ethmesh.macaddr
|
||||
then
|
||||
echo "MAC for ethmesh is set already"
|
||||
else
|
||||
echo "Fixing MAC on eth0.3 (ethmesh)"
|
||||
NEW_MACADDR=$(cat /sys/class/net/eth1/address)
|
||||
uci set network.ethmesh.macaddr=$NEW_MACADDR
|
||||
uci commit
|
||||
ifconfig eth0.3 down
|
||||
ifconfig eth0.3 hw ether $NEW_MACADDR
|
||||
ifconfig eth0.3 up
|
||||
/etc/init.d/network reload
|
||||
fi
|
||||
|
||||
if uci get network.mesh.macaddr
|
||||
then
|
||||
echo "MAC for mesh is set already"
|
||||
else
|
||||
echo "Fixing MAC on br-mesh (mesh)"
|
||||
NEW_MACADDR=$(cat /sys/class/net/eth0/address)
|
||||
uci set network.mesh.macaddr=$NEW_MACADDR
|
||||
uci commit
|
||||
ifconfig br-mesh down
|
||||
ifconfig br-mesh hw ether $NEW_MACADDR
|
||||
ifconfig br-mesh up
|
||||
/etc/init.d/network reload
|
||||
fi
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
|
||||
if ! uci get nodewatcher.@network[0].client_interfaces; then
|
||||
IF="eth0.1 wlan0-1"
|
||||
echo "Setting nodewatchers client interfaces to: $IF"
|
||||
uci set nodewatcher.@network[0].client_interfaces="$IF"
|
||||
uci commit
|
||||
fi
|
||||
|
||||
if uci get network.ethmesh.macaddr
|
||||
then
|
||||
echo "MAC for ethmesh is set already"
|
||||
else
|
||||
echo "Fixing MAC on eth0.3 (ethmesh)"
|
||||
NEW_MACADDR=$(cat /sys/class/net/eth1/address)
|
||||
uci set network.ethmesh.macaddr=$NEW_MACADDR
|
||||
uci commit
|
||||
ifconfig eth0.3 down
|
||||
ifconfig eth0.3 hw ether $NEW_MACADDR
|
||||
ifconfig eth0.3 up
|
||||
/etc/init.d/network reload
|
||||
fi
|
||||
|
||||
if uci get network.mesh.macaddr
|
||||
then
|
||||
echo "MAC for mesh is set already"
|
||||
else
|
||||
echo "Fixing MAC on br-mesh (mesh)"
|
||||
NEW_MACADDR=$(cat /sys/class/net/wlan0/address)
|
||||
uci set network.mesh.macaddr=$NEW_MACADDR
|
||||
uci commit
|
||||
ifconfig br-mesh down
|
||||
ifconfig br-mesh hw ether $NEW_MACADDR
|
||||
ifconfig br-mesh up
|
||||
/etc/init.d/network reload
|
||||
fi
|
||||
|
Loading…
Reference in New Issue