From: <abe...@us...> - 2014-11-08 14:37:05
|
Revision: 6808 http://sourceforge.net/p/astlinux/code/6808 Author: abelbeck Date: 2014-11-08 14:37:01 +0000 (Sat, 08 Nov 2014) Log Message: ----------- network, DHCP client tweaks... 1) EXTIF bring up the interface and wait 4 seconds before calling udhcpc so the link is up 2) EXT2IF bring up the interface but unlike EXTIF let ifplugd call udhcpc such that the EXT2IF link may be down without issues 3) Setup EXT2IF before EXTIF so the time spent by EXTIF/udhcpc also allows the background EXT2IF/ifplugd/udhcpc to complete at the same time Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/network =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2014-11-07 23:17:30 UTC (rev 6807) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2014-11-08 14:37:01 UTC (rev 6808) @@ -495,8 +495,25 @@ #end static ip on 2nd if fi + #DHCP Failover Interface + if [ -n "$EXT2IF" -a -z "$EXT2IP" ] && ! isextppp ext2if; then + ifplugd -apq -t2 -u3 -d3 -i $EXT2IF -r /etc/ifplugd/udhcpc.action + ip link set dev $EXT2IF up + sleep 4 + + # No DHCPv6 - Static IPv6 if defined + if [ "$IPV6" = "yes" -a -n "$EXT2IPV6" -a -n "$EXT2GWIPV6" ]; then + ip -6 addr add $EXT2IPV6 dev $EXT2IF + for x in $EXT2ROUTESIPV6; do + ip -6 route add $x via $EXT2GWIPV6 dev $EXT2IF metric 1 + done + fi + fi + #DHCP if [ -n "$EXTIF" -a -z "$EXTIP" ] && ! isextppp extif; then + ip link set dev $EXTIF up + sleep 4 udhcpc -b -T2 -t6 -S -s /etc/udhcpc.script -H $HOSTNAME -p /var/run/udhcpc-$EXTIF.pid -i $EXTIF ifplugd -apq -t2 -u3 -d3 -i $EXTIF -r /etc/ifplugd/udhcpc.action @@ -507,20 +524,6 @@ fi fi - #DHCP - if [ -n "$EXT2IF" -a -z "$EXT2IP" ] && ! isextppp ext2if; then - udhcpc -b -T2 -t6 -S -s /etc/udhcpc.script -H $HOSTNAME -p /var/run/udhcpc-$EXT2IF.pid -i $EXT2IF - ifplugd -apq -t2 -u3 -d3 -i $EXT2IF -r /etc/ifplugd/udhcpc.action - - # No DHCPv6 - Static IPv6 if defined - if [ "$IPV6" = "yes" -a -n "$EXT2IPV6" -a -n "$EXT2GWIPV6" ]; then - ip -6 addr add $EXT2IPV6 dev $EXT2IF - for x in $EXT2ROUTESIPV6; do - ip -6 route add $x via $EXT2GWIPV6 dev $EXT2IF metric 1 - done - fi - fi - ##DMZ Network if [ -n "$DMZIF" -a -n "$DMZIP" -a -n "$DMZNM" -a "$DMZIF" != "none" ]; then ip addr add $DMZIP/$DMZNM brd + dev $DMZIF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |