auto eth1 iface eth1 inet static address 172.16.14.251 netmask 255.255.255.0 gateway 172.16.14.1 iface eth1 inet6 static pre-up modprobe ipv6 address 2001:620:40b:555::4 netmask 64 gateway 2001:620:40b:555::1Don’t forget to restart the networking service to take this configuration into account:
#/etc/init.d/networking restartStep 2: install the DHCPv6 server
#apt-get install isc-dhcp-serverStep 3: configure the DHCPv6 server
INTERFACES="eth1"Configure the IPv4 address Pool by editing/creating the /etc/dhcp/dhcpd.conf file:
option domain-name "buntschu.ch"; option domain-name-servers ns.buntschu.ch; default-lease-time 600; max-lease-time 7200; log-facility local7; subnet 172.16.14.0 netmask 255.255.255.0 { range 172.16.14.100 172.16.14.110;}Configure the IPv6 address Pool by editing/creating the /etc/dhcp/dhcpd6.conf file:
option domain-name "buntschu.ch"; option domain-name-servers ns.buntschu.ch; default-lease-time 600; max-lease-time 7200; log-facility local7; subnet6 2001:620:40b:555::/64 { range6 2001:620:40b:555::100 2001:620:40b:555::110;}Create a second startup file for the DHCPv6 server
#cp /etc/init.d/isc-dhcp-server /etc/init.d/isc-dhcp6-server #update-rc.d isc-dhcp6-server defaultsModify the new file “/etc/init.d/isc-dhcp6-server” to support IPv6 by:
CONFIG_FILE=/etc/dhcp/dhcpd6.confmodifiy the DHCPID variable:
DHCPDPID=/var/run/dhcp-server/dhcpd6.pidThe DHCP Deamon is controlled by the “apparmor”, so we need to authorize the DHCPv6 to create some files and access some others. Here are the lines to add to the “/etc/apparmor.d/usr.sbin.dhcpd” file:
... network inet6 raw, @{PROC}/[0-9]*/net/if_inet6 r, /var/lib/dhcp/dhcpd6.leases* lrw, /var/run/dhcp-server/dhcpd6.pid w, ...Don’t forget to restart the “apparmor” process:
#/etc/init.d/apparmor restartYour are now ready to start both servers !
#/etc/init.d/isc-dhcp-server start #/etc/init.d/isc-dhcp6-server start
Happy playing with IPv6 !
原文地址:
http://www.buntschu.ch/blog/?p=344