3 MAC2EUI64=/usr/bin/mac2eui64
5 source /etc/default/snf-network
11 LAST=$((GANETI_INSTANCE_NIC_COUNT - 1))
12 for idx in $(seq $FIRST $LAST); do
13 ip=GANETI_INSTANCE_NIC${idx}_IP
14 mac=GANETI_INSTANCE_NIC${idx}_MAC
15 mode=GANETI_INSTANCE_NIC${idx}_MODE
16 link=GANETI_INSTANCE_NIC${idx}_LINK
17 network=GANETI_INSTANCE_NIC${idx}_NETWORK
18 subnet6=GANETI_INSTANCE_NIC${idx}_NETWORK_SUBNET6
19 tags=GANETI_INSTANCE_NIC${idx}_NETWORK_TAGS
24 eval NETWORK=\$$network
25 eval SUBNET6=\$$subnet6
31 uplink=$(ip route list table $LINK | grep "default via" | awk '{print $5}')
32 uplink6=$(ip -6 route list table $LINK | grep "default via" | awk '{print $5}')
33 eui64=$($MAC2EUI64 $MAC $SUBNET6 2>/dev/null)
34 if [ "$GANETI_INSTANCE_PRIMARY" = "$host.$domain" ]; then
35 # This runs on the source node
36 hooks-log clear-proxy-ndp "ip -6 neigh del proxy $eui64 dev $uplink6"
37 ip -6 neigh del proxy $eui64 dev $uplink6 >/dev/null 2>&1
39 # This runs on the target node
40 # Send GARP from host to upstream router to speed up mac change for the VMs IP
41 hooks-log clear-proxy-ndp "arping -c3 -I $uplink -U $IP"
42 echo 1 > /proc/sys/net/ipv4/ip_nonlocal_bind
43 arping -c3 -I $uplink -U $IP
44 echo 0 > /proc/sys/net/ipv4/ip_nonlocal_bind
45 # Send Unsolicited Neighbor Advertisement to speed up nd change for the VMs IP
46 hooks-log clear-proxy-ndp "ndsend $eui64 $uplink6"
47 ndsend $eui64 $uplink6