Monday, April 11, 2016

configure ipv6 dhcp server on linux

IPv6 (Internet Protocol Version 6) is the latest version of Internet Protocol, IP. IPv6 is developed to solve the IPv4 address exhaustion. ipv6 is 128 bit unlike ipv4 only 32 bit long. so ipv6 total number can be 3.4×10^38 and ipv4 total number of host is only 4.3 billion.

***info***
server, dhcp interface: eth0
           eth0 ipv6 address: 2001:db8:1111::1/64
           ipv6 address pool: 2001:db8:1111::/64
           dns 1 and 2 : 2001:4860:4860::8888,2001:4860:4860::8844


***server***
1- install the dhcp ipv6 server, the package call dibbler-server
$ sudo apt-get install dibbler-server

2- modify its configuration file /etc/dibbler/server.conf as below
log-level 8
log-mode short
preference 0
iface "ens38" {
 // also ranges can be defines, instead of exact values
 t1 1800-2000
 t2 2700-3000
 prefered-lifetime 3600
 valid-lifetime 7200

 class {
   pool 2001:db8:1111::/64
 }

     #pd-poll 2001:db8:4444::/80
 option dns-server 2001:4860:4860::8888,2001:4860:4860::8844

}

3- restart the dibbler-server in order to make the modification make affect.
$ sudo service dibbler-server restart

***client***
1- to get the ipv6 from dhcp server we can use dhclient command like below (request ipv6 from interface eth1)
$ dhclient -r -6 eth1

2- you ifconfig on interface eth1 will see the new ipv6 assigned from server
$ ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 00:0c:29:d8:bf:f8  
          inet6 addr: 2001:db8:1111:0:233b:a2e6:46c:ba08/64 Scope:Global
          inet6 addr: fe80::20c:29ff:fed8:bff8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:47 errors:0 dropped:0 overruns:0 frame:0
          TX packets:58 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6385 (6.3 KB)  TX bytes:6438 (6.4 KB)

- screenshot ping6 test to our server ip address 2001:db8:1111::1


No comments:

Post a Comment