This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:dedicated-server:network:ipv6:prefix [2016/06/24 11:17] external edit
en:dedicated-server:network:ipv6:prefix [2020/04/22 16:00] (current)
dedibox [Start your DHCPv6 client at boot]
Line 1: Line 1:
 ======= /48 IPv6 prefix ======= ======= /48 IPv6 prefix =======
-Each customer can request a /48 IPv6 prefix for free+<note tip>  
-If you have not yet ordered your block yet, you can [[en:dedicated-server:​network:​ipv6:​start|do it now]].+**Requirements:​** 
 +  * You have an account at [[https://console.online.net|console.online.net]]\\ 
 +  * You have [[https://​www.online.net/​fr/​serveur-dedie|Dedibox]] dedicated server 
-====== Installation of the client ====== 
-You have to install a DHCPv6 client on your server. We recommend ​the use of Dibbler +Each customer can request a /48 IPv6 prefix for free. 
-<​note>​We recommend to use the version 1.0 of Dibbler</​note>​+If you have not yet ordered ​your block yet, you can [[en:​dedicated-server:​network:​ipv6:​start|do it now from the management console]].
-===== On Debian 6/7 =====+<note important>​On servers supporting [[en:​dedicated-server:​network:​ipv6:​slaac|IPv6 SLAAC]], [[en:​dedicated-server:​network:​ipv6:​slaac#​activation|SLAAC has to be enabled]] in order to ensure that DHCPv6 works correctly. If disabled, a server will not be able to learn its IPv6 default route.</note> 
 +<note important>​We don't recommend to use the dibbler client anymore, as there is a known bug with it.</​note>​
-<​note>​The following commands have to be executed as root or using sudo</​note>​+====== How to configure the DHCPv6 client ======
-Start with the download of the client: +We will use ''​dhclient''​.
-<​code>​wget "​http://​klub.com.pl/​dhcpv6/​dibbler/​dibbler-1.0.1.tar.gz"</​code>​+
-Get the required things ​to compile ​the client+You'll need to edit the following file ''/​etc/​dhcp/​dhclient6.conf'' ​
-<​code>​apt-get install build-essential</​code>​+<​code>​ 
 +interface "​eno1"​ { 
 +   send dhcp6.client-id DUID; 
-Extract ​the archive ​and compile ​the client: +You will have to adapt the interface name (''​eno1''​) ​and the ''​DUID'',​ [[https://console.online.net/fr/network/​|available in your console]]. 
-<​code>​tar -xvf dibbler-1.0.1.tar.gz && cd dibbler-1.0.1 && ​./configure && make install clean</code>+===== Start your DHCPv6 client at boot =====
-Make the folders required by the daemon: +Once the client is configured, you'll need to create a new ''​<nowiki>SystemD</nowiki>''​ service.
-<code>mkdir -p /​var/​lib/​dibbler /​etc/​dibbler</code>+
-Download and install ​the file required for the automatic start of the daemon: +Create ​the following ​file, adapting ​the interface name (''​eno0''​) and the DUID ''​/etc/systemd/system/dhclient.service'':​
-<​code>​wget -O "/etc/init.d/​dibbler-client"​ "http://pastebin.com/​raw.php?​i=tACkVS32"​ && chmod 755 /​etc/​init.d/​dibbler-client"</​code>​+
-Configure the automatic launch on boot: +<​code>​ 
-<code>​update-rc.d dibbler-client defaults</​code> +[Unit] 
- +Description=dhclient for sending DUID IPv6 
-===== On Debian 8 ===== +After=network-online.target 
- +Wants=network-online.target
-<​note>​The following commands have to be executed as root or using sudo</​note>​ +
- +
-Start with the download of the client: +
-<​code>​wget "​http://​klub.com.pl/​dhcpv6/​dibbler/​dibbler-1.0.1.tar.gz"</​code>​ +
- +
-Get the required things to compile the client: +
-<​code>​apt-get install build-essential</​code>​ +
- +
-Extract the archive and compile the client: +
-<​code>​tar -xvf dibbler-1.0.1.tar.gz && cd dibbler-1.0.1 && ./configure && make install clean</​code>​ +
- +
-Make the folders required by the daemon: +
-<​code>​mkdir -p /​var/​lib/​dibbler /​etc/​dibbler</​code>​ +
- +
-To launch dibbler automatically during the boot, create the file ''/​etc/​systemd/​system/​dibbler.service'':​ +
-<​code>​[Unit] +
-Description=Dibbler +
 [Service] [Service]
-Type=simple +Restart=always 
-ExecStart=/usr/local/sbin/dibbler-client start +RestartSec=10 
-ExecStop=/usr/local/sbin/dibbler-client stop +Type=forking 
-PrivateTmp=true +ExecStart=/sbin/dhclient -cf /etc/dhcp/​dhclient6.conf -6 -P -v eno1 
-NonBlocking=yes+ExecStop=/​sbin/​dhclient ​-x -pf /​var/​run/​dhclient6.pid
 [Install] [Install]
-Reload the systemd configuration:​ +<note>''​dhclient'''​s path may vary depending on your OS. To know the exact path, use the following command: ''​which dhclient''​</note>
-<code>systemctl daemon-reload</code>+
-Enable the service: +Then, enable it for every reboot''​systemctl enable ​dhclient.service''​.
-<​code>​systemctl enable ​dibbler.service</​code>​+
-Start the service: 
-<​code>​systemctl start dibbler.service</​code>​ 
-===== On Ubuntu =====+===== Configure the Network on Ubuntu ​16 & Debian 8 and 9 =====
-<code>​sudo ​apt-get install dibbler-client</code>+<note>The following commands have to be used as root or with ''​sudo''​</note>
-To stop the client, you have to type: +Start by editing ''​/​etc/​network/​interfaces'' ​as follows:
-<​code>​sudo service dibbler-client stop</​code>​ +
- +
-===== On CentOS 6 ===== +
- +
-<​note>​The following commands have to be run as root or using sudo</​note>​ +
- +
-Start by downloading the client: +
-<​code>​wget "​http://​klub.com.pl/​dhcpv6/​dibbler/​dibbler-1.0.1.tar.gz"</​code>​ +
- +
-Install the required tools for the compilation:​ +
-<​code>​yum groupinstall "​Development Tools"</​code>​ +
- +
-Now you have to extract the archive and compile the source code: +
-<​code>​tar -xvf dibbler-1.0.1.tar.gz && cd dibbler-1.0.1 && ./configure && make install clean</​code>​ +
- +
-Create the required folders for the daemon: +
-<​code>​mkdir -p /​var/​lib/​dibbler ​/etc/​dibbler</​code>​ +
- +
-Download and install the file required for the automatic start of the daemon: +
-<​code>​wget -O "/​etc/​init.d/​dibbler-client"​ "​http://​pastebin.com/​raw.php?​i=tACkVS32"​ && chmod 755 "/​etc/​init.d/​dibbler-client"</​code>​ +
- +
-Finally, prepare the automatic launch on boot: +
-<​code>​chkconfig dibbler-client on</​code>​ +
- +
-====== Configuration of the client ====== +
- +
-Create the file that contains your DUID (the equivalent to a virtual MAC) and enter the DUID, which can be found in [[https://​console.online.net/​en/network/|your account]]. +
-<​code>​nano /​var/​lib/​dibbler/​client-duid</​code>​ +
- +
-<​note>​**Keep your DUID secret, as it is the identfication to recover your block**</​note>​ +
- +
- +
-Create the configuration file: +
-<​code>​nano /​etc/​dibbler/​client.conf</​code>​ +
- +
-The content of the file should be as following:+
 <​code>​ <​code>​
-auth-protocol reconfigure-key +auto eno1 
-auth-replay monotonic +iface eno1 inet6 static 
-auth-methods digest-hmac-md5 +    ​address IPV6ADDRESS 
-duid-type duid-ll +    ​netmask PREFIXLENGTH
-inactive-mode +
-log-level 8 +
-iface eth0 { +
-    ​pd +
 </​code>​ </​code>​
-<​note>​**Don't forget ​to configure your firewall and allow UDP connections on port 546**</​note>​+You'll need to replace ''​eno1''​ with the proper interface name.\\ 
 +With Debian & old versions of Ubuntu, it's usually ''​eth0''​.
-<​note ​critique>Don't forget to configure an IP address ​on the interfaceas described in [[http://​documentation.online.net/​en/​serveur-dedie/​reseau/​ipv6-prefix#​network_configuration|"​Configuration ​the client"​]]</​note>​ +<​note ​tip>The network interface is initialized with the command ​''​allow-hotplug''​ by default ​on **Debian 9**. It is possible that the network restart fails with this configuration. In this caseyou can initialize ​the network with ''​auto'' ​to avoid the problem.</note
- +==== Alternate ​configuration ​without SystemD====
-Start the dibbler client (to see the debug info for the first time): +
-<​code>​dibbler-client run</code+
- +
- +
-You should get an output like: +
-<​code>​PD:​ Adding prefix 2a01:​e0b:​20ab::/​48 to all interfaces</​code>​ +
- +
- +
- +
-====== Alternative ​configuration ​using dhclient ​====== +
- +
-The configuration requires a recent dhclient (at least version 4.1). +
-Here is an example of a dhclient6.conf : +
-<​code>​nano /​etc/​dhcp/​dhclient6.conf</​code>​+
 +If you don't use ''<​nowiki>​SystemD</​nowiki>''​ to start your services, you can configure your ''/​etc/​network/​interfaces''​ as follow:
 <​code>​ <​code>​
-interface "​eth0"​ { +iface eno1 inet6 static 
-   send dhcp6.client-id votre_duid; +    ​pre-up modprobe ipv6 
-}+    pre-up dhclient -cf /​etc/​dhcp/​dhclient6.conf -6 -P -d -v $IFACE 
 +    address IPV6ADDRESS 
 +    ​netmask PREFIXLEN
 </​code>​ </​code>​
-Launch ​the dhclient with the following command: +Still adapting your interface name (''​eno1''​) to your needs, as well as the IPv6 address and the Netmask.
-<​code>​dhclient -cf /​etc/​dhcp/​dhclient6.conf -6 -P -v eth0</​code>​+
-=====Network ​configuration ======+===== Configure the Network ​on CentOS 7 =====
-Once the dibbler client works properly, you can configure your IPv6 interfaces:+<​note>​The following commands have to be used as root or with ''​sudo''</​note>​
-===== In Debian ===== +After configuring your ''​dhclient''​ and ''​<nowiki>SystemD</​nowiki>'',​ you'll need to edit ''​/etc/sysconfig/network-scripts/ifcfg-eth0''​:
- +
-<code>nano /​etc/​network/​interfaces</​code>​ +
- +
-You have to add something like:+
 <​code>​ <​code>​
-iface eth0 inet6 static +# Generated by parse-kickstart 
-    ​address ​IPV6ADDRESS +UUID=xxxxx 
-    ​netmask SIZEOFTHEBLOCK+DNS1= 
 +NAME="​System eth0" ​
 </​code>​ </​code>​
-===== In CentOS ===== 
-<​code>​nano /​etc/​sysconfig/​network-scripts/​ifcfg-eth0</​code>​ 
-You have to add a line like : 
-Just after ''​IPV6INIT="​yes"''​ 
 ---- ----
-Obviously, the address and block size should be replaced ​with your own.+Once done with the configuration,​ you can reboot ​your server to check that the service & the configuration are correctly applied at the boot!
-If you do not want to restart ​your server, you can add your IPv6 manually: +<​note>​You will need to allow in your firewall 546/UDP Incoming & 547/UDP Outgoing.</note>
-<​code>/​sbin/ifconfig eth0 inet6 add IPV6ADDRESS/SIZEOFTHEBLOCK</code>+
-If you are using dhclient, you have to add these lines after **netmask**:​ +====== Test your configuration ======
-<​code>​ +
-    pre-up dhclient -cf /​etc/​dhcp/​dhclient6.conf -pf /​run/​dhclient6.eth0.pid -6 -P eth0 +
-    pre-down dhclient -x -pf /​run/​dhclient6.eth0.pid +
-     +
-====== Test the configuration ======+Launch ​the ''​dhclient''​ with the following command: 
 +<​code>​dhclient -cf /​etc/​dhcp/​dhclient6.conf -6 -P -v eth0</​code>​
-To verify that everything is working properlya simple ping will be enough+To check your IPv6 connectivityyou can use the ''​PING''​ command:
 <​code>​ping6 ipv6.google.com</​code>​ <​code>​ping6 ipv6.google.com</​code>​
 ====== Debug ====== ====== Debug ======
-If the configuration ​does not work for you, you can check the name of your interfaces ​with the following command: ​+If the configuration ​is not working ​for you, check your interface ​name with the following command:
 <​code>​ifconfig -a</​code>​ <​code>​ifconfig -a</​code>​
-The examples ​given are for eth0. If you main interface ​is called differently, you will have to change ​all occurences of this name to the name of your interface.+Also, your server need to be configured to accept ''​RA''​ (Router Advertisement).\\ 
 +By default, your server won't accept to forward packets from an interface to another if it's automatically configured (through ''​DHCPv6''​). 
 +If you need to forward IPv6 packets and use an automated configuration,​ you'll need to set your ''​sysctl''​ ''​net.ipv6.conf.all.accept_ra''​ to ''​2''​ in ''/​etc/​sysctl.conf''​.\\ 
 +This is useful usually for Hypervisor Host such as ''​Proxmox''​.  
 +The examples are given for ''​eth0''/''​eno1'',​ if your main interface ​have a different name, you'll need to modify it in all of your configurations files.
 ===== Traffic limitation of your client ===== ===== Traffic limitation of your client =====
-In certain cases, some DHCPv6 clients may unfortunately sends several requests per second (especially ​''​dchp6c''​). +In certain cases, some DHCPv6 clients may unfortunately sends several requests per second (especially dchp6c).
-This triggers blocking of your servers network port by our automatic protection, as it will be seen as a source of an UDP flood. ​+This triggers blocking of your servers network port by our automatic protection, as it will be seen as a source of an UDP flood.
 To avoid this problem, we invite you to limit the traffic sent from your dhclient6 directly in your firewall configuration. To avoid this problem, we invite you to limit the traffic sent from your dhclient6 directly in your firewall configuration.
-Following an example for ''​IPTABLES'' ​:+Following an example for IPTABLES :
 <​code>​ <​code>​
 ip6tables -A OUTPUT -p udp --dport 547 -m limit --limit 10/min --limit-burst 5 -j ACCEPT ip6tables -A OUTPUT -p udp --dport 547 -m limit --limit 10/min --limit-burst 5 -j ACCEPT
Line 218: Line 148:
 </​code>​ </​code>​
-===== In rescue ​mode =====+===== In Rescue ​mode =====
-Pour tester l'IPv6 de votre serveur en mode secours, lancer d'​abord la machine en Ubuntu 14, le client dibbler est déjà installer dessus.  +To test the IPv6  on your server in rescue mode, reboot the server in rescue mode with the "Ubuntu 14 - Trusty"​ mode. The ''​dhclient'' ​is already ​available ​on it.
-To test IPv6 on your server in rescue mode, start with booting your server on Ubuntu 14, the dibbler client ​is already ​installed ​on it. +
-Create the file that contains the DUID (the equivalent to a virtual MAC) and enter the DUID which you can find [[https://​console.online.net/​en/network/|in your console]].+Create the file which will contain your DUID with the help of the [[#​how_to_configure_the_dhcpv6_client|documentation above]]. 
 +You can find your DUID in [[https://​console.online.net/​fr/​network/​|your console]].
-<​code>​nano /var/lib/dibbler/​client-duid</​code>​+<​code>​nano /etc/dhcp/dhclient6.conf</​code>​
-Now you have to modify ​the file+First, start the ''​dhclient''​
-<​code>​nano /etc/dibbler/client.conf</​code>​+<​code>​dhclient -cf /etc/dhcp/dhclient6.conf -6 -P -v <​interface>​</​code>​
-You should edit itso it looks like this: +After, add the IPv6 address to your network ​interface:​ 
-<​code>​ +<​code>/​sbin/​ifconfig ​<​interface> ​inet6 add IPV6ADDRESS/PREFIXLENGTH</​code>​
-auth-protocol reconfigure-key +
-auth-replay monotonic +
-auth-methods digest-hmac-md5 +
-duid-type duid-ll +
-inactive-mode +
-log-level 8 +
-iface eth0 { +
-    pd +
-</​code>​ +
- +
-Dibbler is now configured, you will have to add an IP address to your interface ​using the following command: +
- +
-<​code>/​sbin/​ifconfig ​eth0 inet6 add IPV6ADDRESSE/BLOCKSIZE</​code>​ +
- +
-In a last step you have to start your dibbler client: +
-<​code>​dibbler-client run</​code>​ +
- +
-Test de l'​IPv6:​+
 +Then you can try to ping6:
 <​code>​ping6 ipv6.google.com</​code>​ <​code>​ping6 ipv6.google.com</​code>​