addip script to depracate IPv6 IPs upon adding

Version 1.48


When an IPv6 IP is added to a device, the system sometimes likes to use it as the default IP, because it was added last. This fix will change the script: /usr/local/directadmin/scripts/addip to have the addIPv6() function to include the /sbin/ip command, below. The "preferred_lft 0" changes the state of the IPv6 IP. You can view the current state of your IPs like this: ip -6 addr show dev eth0 where you know it's depracated, if you see this beside the IP you dont want exim to bind to: inet6 fe80::230:42ff:fd57:16b2/64 scope link deprecated if it looks like this, then it didn't work: inet6 fe80::230:42ff:fd57:16b2/64 scope link Forum thread: ------------------------------------ addIPv6() { MASK=/64 MCOUNT=`echo $2 | grep -c /` if [ "$MCOUNT" -gt 0 ]; then MASK=$2 fi /sbin/ifconfig $ETH_DEV inet6 add ${1}${MASK} /sbin/ip -6 addr change ${1}${MASK} dev $ETH_DEV preferred_lft 0 >/dev/null 2>&1 exit 0; } ------------------------------------ Note: CentOS 5 and likely other older OSs may not support the "change" option with the ip command. This is why I've piped everything to /dev/null.

Interested to try DirectAdmin? Get a 30-day Free Trial!