Skip to content

Instantly share code, notes, and snippets.

@luodaoyi
Created September 12, 2018 09:17
Show Gist options
  • Save luodaoyi/c4bc9d20bd3e7ec6a6734d21b7f3df1b to your computer and use it in GitHub Desktop.
Save luodaoyi/c4bc9d20bd3e7ec6a6734d21b7f3df1b to your computer and use it in GitHub Desktop.
online.net server setup ipv6 shell
```shell
#!/bin/bash
DUID=$1
skill -9 dibbler-client
dpkg -P dibbler-client
rm -rvf /etc/dibbler /var/log/dibbler /var/lib/dibbler
apt-get install -y wide-dhcpv6-client vim-common
/etc/init.d/wide-dhcpv6-client stop
echo 'profile default { script "/etc/wide-dhcpv6/dhcp6c-script"; };' > /etc/wide-dhcpv6/dhcp6c.conf
echo 'id-assoc pd { prefix-interface eno1 { }; };' >> /etc/wide-dhcpv6/dhcp6c.conf
echo 'id-assoc na { };' >> /etc/wide-dhcpv6/dhcp6c.conf
echo 'interface eth0 { send ia-na 0; send ia-pd 0; };' >> /etc/wide-dhcpv6/dhcp6c.conf
echo $DUID | awk '{ gsub(":"," "); printf "0: 0a 00 %s\n", $0 }' | xxd -r > /var/lib/dhcpv6/dhcp6c_duid
/etc/init.d/wide-dhcpv6-client start
```
use:
```
./setup-dhcpv6.sh 00:03:00:01:23:45:67:89:ab:cd
00:03:00:01:23:45:67:89:ab:cd is DUID
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment