summaryrefslogtreecommitdiff
path: root/templates/system/ipv6/strict-dad/node.def
blob: c52de9884a94f3ab81169ed6c492608667895fa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

priority: 290 # Must be run before any interfaces are configured

help: Disable IPv6 operation on interface when DAD fails on LL addr

# Enable strict DAD behavior.  Disable IPv6 operation on an interface
# if DAD fails on the EUI-64 based link-local address.
#
create:
    sudo sh -c "echo 2 > /proc/sys/net/ipv6/conf/all/accept_dad"
    sudo sh -c "echo 2 > /proc/sys/net/ipv6/conf/default/accept_dad"
    for ifname in /sys/class/net/eth* ; do
	if [ -d $ifname ]; then
	    ifname=${ifname#/sys/class/net/}
       	    sudo sh -c "echo 2 > /proc/sys/net/ipv6/conf/$ifname/accept_dad"
	fi
    done


# Revert back to liberal DAD behavior
delete: 
    sudo sh -c "echo 1 > /proc/sys/net/ipv6/conf/all/accept_dad"
    sudo sh -c "echo 1 > /proc/sys/net/ipv6/conf/default/accept_dad"
    for ifname in /sys/class/net/eth* /sys/class/net/en* ; do
	if [ -d $ifname ]; then
	    ifname=${ifname#/sys/class/net/}
       	    sudo sh -c "echo 1 > /proc/sys/net/ipv6/conf/$ifname/accept_dad"
	fi
    done