How to setup ipv6 with online.net dedi – Debian
IPv6 setup with Debian and Wide DHCP Client for ipv6
To setup ipv6 in dedibox on debian , create a .sh file (script credits to rm_ ) :
1 |
nano ipv6.sh |
Then copy the following in it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#!/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 eth0 { }; };' >> /etc/wide-dhcpv6/dhcp6c.conf echo 'interface eth0 { 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 |
then do:
1 |
chmod +x ipv6.sh |
find your duid from online.net console and run the script like and select eth0 when it asks for interface
1 |
./ip6.sh YOURDUID |
To find your GATEWAY type the command below and look for a line with router advertisement , the ipv6 there is your default gateway:
1 |
tcpdump -i eth0 -n -s 4000 -v ip6 |
now edit your /etc/network/interfaces and add:
1 2 3 4 5 |
iface eth0 inet6 static address youripv6block::1 netmask 48 gateway yourgatewayfrom above accept_ra 1 |
If you want to add extra IP’s then just add the following below accept_ra
1 2 |
up /sbin/ifconfig eth0 inet6 add 2001:your-address::2/48 up /sbin/ifconfig eth0 inet6 add 2001:your-address::3/48 |
In your sysctl.conf Add/change the following to like these:
1 2 3 4 |
net.ipv6.conf.all.autoconf = 0 net.ipv6.conf.default.autoconf = 0 net.ipv6.conf.eth0.autoconf = 0 net.ipv6.conf.eth0.accept_ra=1 |
To apply settings:
1 |
sysctl -p |
Now type:
1 |
nano /etc/rc.local |
and paste this before exit 0:
1 2 |
/etc/init.d/wide-dhcpv6-client restart ifdown eth0 && ifup eth0 |
Now type:
1 |
ifdown eth0 && ifup eth0 |
Also you need to have port 546 and port 547 opened in your profile for udp
now:
1 2 3 4 5 6 |
ping6 ipv6.google.com: PING ipv6.google.com(la-in-x64.1e100.net) 56 data bytes 64 bytes from la-in-x64.1e100.net: icmp_seq=1 ttl=53 time=38.7 ms 64 bytes from la-in-x64.1e100.net: icmp_seq=2 ttl=53 time=38.7 ms 64 bytes from la-in-x64.1e100.net: icmp_seq=3 ttl=53 time=38.7 ms |