IPv6 Network Test Environment


IPv6 Router Setup

(여기서는 우분투를 사용하여 가상의 라우터처럼 설정함)
There are two interfaces: eth0 for connecting to the Internet and enx00e04c03475d for connecting to the IPv6 network.
0) Setup router interfaces
$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.4
netmask 255.255.255.0
gateway 192.168.0.250
dns-nameserver 10.0.0.2 10.0.0.5 8.8.8.8
auto enx00e04c03475d
iface enx00e04c03475d inet6 static
address 2001:db8:0:1::1
netmask 64
pre-up modprobe ipv6
up echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
up echo 0 > /proc/sys/net/ipv6/conf/all/autoconf
$ sudo /etc/init.d/networking restart
1) Setup the router advertisement service
sudo apt-get install radvd
$ cat /etc/radvd.conf
interface enx00e04c03475d
{
            AdvSendAdvert on;
            prefix 2001:db8:0:1::4/64
            {
                   AdvOnLink on;
                   AdvAutonomous on;
                   AdvRouterAddr on;
            };
                      RDNSS 2001:db8:0:1::1
                      {
                     };
};
$ sudo sysctl -w net.ipv6.conf.all.forwarding=1
$ sudo /etc/init.d/radvd start
$ sudo /etc/init.d/radvd status
$ sudo /etc/init.d/radvd restart
AdvManagedFlag on|off
When set, hosts use the administered (stateful) protocol for address autoconfiguration in addition to any addresses autoconfigured using stateless address autoconfiguration. The use of this flag is described in RFC 4862.
Default: off
2) Setup DHCPv6 server
sudo apt-get install isc-dhcp-server
$ cat /etc/dhcp/dhcpd6.conf
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet6 2001:db8:0:1::/64 {
# Range for clients
range6 2001:db8:0:1::129 2001:db8:0:1::254;
# Range for clients requesting a temporary address
range6 2001:db8:0:1::/64 temporary;
# Additional options
option dhcp6.name-servers 2001:db8:0:1::1;
option dhcp6.domain-search "humaxdigital.com";
# Prefix range for delegation to sub-routers
prefix6 2001:db8:0:100:: 2001:db8:0:f00:: /56;
# Example for a fixed host address
host specialclient {
host-identifier option dhcp6.client-id 00:01:00:01:4a:1f:ba:e3:60:b9:1f:01:23:45;
fixed-address6 2001:db8:0:1::127;
}
}

$ sudo dhcpd -6 -d -cf /etc/dhcp/dhcpd6.conf enx00e04c03475d
3) Setup DNS server
sudo apt-get install bind9 bind9utils bind9-doc
$ cat /etc/bind/named.conf.local
//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
zone "dangkhoa.com" {
  type master;
  file "/etc/bind/zone/dangkhoa.com";
};
---
$ cat /etc/bind/named.conf
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
--
$ cat /etc/bind/zone/dangkhoa.com
$TTL 3600
  2002091501 ; Serial
  84600 ; Refresh
  1800 ; Retry
  1209600 ; Expire
  3600 ) ; Minimum
  IN NS ns.dangkhoa.com.
  ns IN A 10.0.12.37 ;
  dangkhoa.com. IN A 10.0.12.37 ;
  dangkhoa.com. IN AAAA 2001:1:1::1 ;

IPv6 Client Setup

1. Stateful Address Auto-configuration
$ cat /etc/network/interfaces
auto eth0
iface eth0 inet6 dhcp
$ sudo /etc/init.d/networking restart
2. Stateless Address Auto-configuration.
$ cat /etc/network/interfaces
auto eth0
iface eth0 inet6 auto
$ sudo /etc/init.d/networking restart

댓글