X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;f=root%2Fetc%2Fnetworking.sh;h=74e0023296f778da67479875915729af1cd98d4b;hb=cbff0d85f54798614fd13fa34c147d457dc8b322;hp=b857a86c062f045c5636c96e2609183797443da3;hpb=cd5d89517d077ee30ce1da5e2a49ff07b4b48be7;p=openwrt-10.03%2F.git diff --git a/root/etc/networking.sh b/root/etc/networking.sh index b857a86c0..74e002329 100755 --- a/root/etc/networking.sh +++ b/root/etc/networking.sh @@ -84,8 +84,15 @@ configure () { ipcalc -s "$if_netmask" || return $DEBUG ifconfig $if $if_ip netmask $if_netmask up - ipcalc -s "$ip_gateway" || return - $DEBUG route add default gw $ip_gateway + ipcalc -s "$if_gateway" || return + $DEBUG route add default gw $if_gateway + + [ -f /etc/resolv.conf ] && return + + echo "# --- creating /etc/resolv.conf ---" + for dns in $(nvram_get ${type}_dns); do { + echo "nameserver $dns" >> /etc/resolv.conf + }; done ;; dhcp) pidfile=/tmp/dhcp-${type}.pid @@ -161,3 +168,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