Skip to content

Instantly share code, notes, and snippets.

@kongou-ae
Created March 11, 2014 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kongou-ae/9484098 to your computer and use it in GitHub Desktop.
Save kongou-ae/9484098 to your computer and use it in GitHub Desktop.
# more /etc/dhcp/dhclient-exit-hooks
#!/bin/bash
FIRST=`/sbin/ifconfig eth0|grep -i global|cut -d ":" -f2,3,4,5`
SECOND=`/sbin/ifconfig eth0|grep -i global|cut -d ":" -f6,7,8,9|cut -d "/" -f1`
IPV6=$FIRST:a$SECOND
for SUFFIX in `echo {0..9}`;do ifconfig eth0 inet6 add $IPV6$SUFFIX/64 > /dev/null 2>&1; done;
for SUFFIX in `echo {a..f}`;do ifconfig eth0 inet6 add $IPV6$SUFFIX/64 > /dev/null 2>&1; done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment