From: <abe...@us...> - 2015-11-01 15:26:51
|
Revision: 7298 http://sourceforge.net/p/astlinux/code/7298 Author: abelbeck Date: 2015-11-01 15:26:48 +0000 (Sun, 01 Nov 2015) Log Message: ----------- dhcpv6, add support for the Failover Interface, no Prefix Delegation, only Request IPv6 Address Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/network =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2015-10-31 02:54:00 UTC (rev 7297) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2015-11-01 15:26:48 UTC (rev 7298) @@ -54,6 +54,20 @@ return 0 } +gen_nopd_dhcp6c_conf() +{ + local interface="$1" + + echo "# Autogenerated. Do not edit. +interface $interface { + send ia-na 1; + send rapid-commit; +}; + +id-assoc na 1 { };" + +} + gen_dhcp6c_conf() { local interface="$1" len id iname int IFS @@ -135,14 +149,18 @@ init_dhcp6c() { - local interface="$1" + local iname="$1" interface="$2" sysctl -w net/ipv6/conf/${interface}/accept_ra=2 >/dev/null # Make DUID persistant ln -sf /mnt/kd/dhcp6c_duid /var/db/dhcp6c_duid - gen_dhcp6c_conf $interface > /etc/wide-dhcpv6/dhcp6c-${interface}.conf + if [ "$iname" = "ext2if" ]; then + gen_nopd_dhcp6c_conf $interface > /etc/wide-dhcpv6/dhcp6c-${interface}.conf + else + gen_dhcp6c_conf $interface > /etc/wide-dhcpv6/dhcp6c-${interface}.conf + fi } ipv6_tunnel() @@ -590,12 +608,15 @@ #DHCP Failover Interface if [ -n "$EXT2IF" -a -z "$EXT2IP" ] && ! isextppp ext2if; then + if [ "$IPV6" = "yes" -a "$EXT2DHCPV6_CLIENT_ENABLE" = "yes" ]; then + init_dhcp6c ext2if $EXT2IF + fi 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 + if [ "$IPV6" = "yes" -a "$EXT2DHCPV6_CLIENT_ENABLE" != "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 @@ -608,7 +629,7 @@ ip link set dev $EXTIF up sleep 4 if [ "$IPV6" = "yes" -a "$DHCPV6_CLIENT_ENABLE" = "yes" ]; then - init_dhcp6c $EXTIF + init_dhcp6c extif $EXTIF dhcp6c -c /etc/wide-dhcpv6/dhcp6c-$EXTIF.conf -p /var/run/dhcp6c-$EXTIF.pid $EXTIF fi udhcpc -b -T2 -t6 -S -s /etc/udhcpc.script -H $HOSTNAME -p /var/run/udhcpc-$EXTIF.pid -i $EXTIF Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2015-10-31 02:54:00 UTC (rev 7297) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2015-11-01 15:26:48 UTC (rev 7298) @@ -242,12 +242,16 @@ #IPV6_AUTOCONF="INTIF" ## DHCPv6 Client -## Enable DHCPv6 client by setting DHCPV6_CLIENT_ENABLE="yes" +## Enable DHCPv6 client on EXTIF by setting DHCPV6_CLIENT_ENABLE="yes" #DHCPV6_CLIENT_ENABLE="yes" #DHCPV6_CLIENT_REQUEST_ADDRESS="yes" # Request IPv6 Address, disable with "no", defaults to "yes" #DHCPV6_CLIENT_REQUEST_PREFIX="yes" # Request Prefix Delegation, disable with "no", defaults to "yes" #DHCPV6_CLIENT_PREFIX_LEN="60" # Prefix Delegation Length, defaults to "60" #DHCPV6_CLIENT_PREFIX_HINT="yes" # Request the Prefix Delegation Length, disable with "no", defaults to "yes" +## +## Enable DHCPv6 client on EXT2IF by setting EXT2DHCPV6_CLIENT_ENABLE="yes" +## Note: No Prefix Delegation, only Request IPv6 Address +#EXT2DHCPV6_CLIENT_ENABLE="yes" ## Configure IPv6 tunnel gateway for 6in4 and 6to4 ## Supported Types: "6in4-static" "6to4-relay" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |