X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;f=root%2Fetc%2Fnetworking.sh;h=c1e6742e363eba61f9ac409837b89a7c4c02ae1e;hb=30e87aab88d7cbb8ba3f77e877a4014e236bc3a7;hp=5242952e931a2a70afe4974ab8d53f74d94602c6;hpb=a91ebb0ed744d2fcd5e9f30abaa2bb922c5b589c;p=openwrt-10.03%2F.git diff --git a/root/etc/networking.sh b/root/etc/networking.sh index 5242952e9..c1e6742e3 100755 --- a/root/etc/networking.sh +++ b/root/etc/networking.sh @@ -31,7 +31,6 @@ if_valid () { echo "# vlan${i}: $hwname $hwaddr => $vif" $DEBUG ifconfig $vif up - #$DEBUG vconfig rem vlan${i} $DEBUG vconfig add $vif $i } ifconfig "$1" >/dev/null 2>&1 || [ "${1%[0-9]}" = "br" ] @@ -57,10 +56,12 @@ configure () { if_valid $if || return if [ "${if%[0-9]}" = "br" ]; then + stp=$(nvram get ${type}_stp) $DEBUG ifconfig $if down $DEBUG brctl delbr $if $DEBUG brctl addbr $if $DEBUG brctl setfd $if 0 + $DEBUG brctl stp $if $stp if_list=$(nvram_get ${type}_ifnames) for sif in $if_list; do { if_valid $sif || continue @@ -101,7 +102,9 @@ configure () { $DEBUG ifconfig $if 0.0.0.0 up - $DEBUG pppd user "$if_username" password "$if_password" defaultroute + $DEBUG /sbin/pppoecd $if -u $if_username -p $if_password -i 0 -I $if_redial -T $if_idletime -k + sleep 5 + $DEBUG /sbin/route add default $if ;; *) echo "$if: $if_proto is not supported" @@ -158,3 +161,12 @@ lan_proto="static" configure lan configure wifi configure wan + +for route in $(nvram_get static_route); do { + ip=${route%%:*} route=${route#*:} + netmask=${route%%:*} route=${route#*:} + gateway=${route%%:*} route=${route#*:} + metric=${route%%:*} route=${route#*:} + if=${route%%:*} + $DEBUG route add -net $ip netmask $netmask gw $gateway metric $metric dev $if +} done