32 lines
678 B
Bash
Executable File
32 lines
678 B
Bash
Executable File
#!/bin/sh
|
|
|
|
|
|
. /lib/functions.sh
|
|
. /lib/gluon/functions/sysconfig.sh
|
|
|
|
uci_remove network lan
|
|
|
|
uci_set network wan type 'bridge'
|
|
uci_set network wan proto 'dhcp'
|
|
EOF
|
|
|
|
|
|
mainaddr=$(sysconfig primary_mac)
|
|
oIFS="$IFS"; IFS=":"; set -- $mainaddr; IFS="$oIFS"
|
|
b2mask=0x02
|
|
|
|
case "$board" in
|
|
tl-wr1043nd|\
|
|
tl-wdr3600|\
|
|
tl-wdr4300) # fix up duplicate mac addresses
|
|
local wanaddr=$(printf "%02x:%s:%s:%02x:%s:%02x" $(( 0x$1 | $b2mask )) $2 $3 $(( (0x$4 + 1) % 0x100 )) $5 $(( (0x$6 + 1) % 0x100 )) )
|
|
|
|
uci_set network wan macaddr "$wanaddr"
|
|
;;
|
|
esac
|
|
|
|
uci_commit network
|
|
|
|
echo 'net.ipv6.conf.all.accept_ra=0' >> /etc/sysctl.conf
|
|
echo 'net.ipv6.conf.default.accept_ra=0' >> /etc/sysctl.conf
|