7-IPv6 Lab Guide
7-IPv6 Lab Guide
1
I. General lab information ................................................................................................................... 3
1. Lab diagram:................................................................................................................................ 4
2
I. General lab information
The practical scenarios in this manual are meant to guide the learner to configure
and IPv4 network and then transition the network to IPv6. The IP address indicated
in the diagram is that which shall be used by course participants to access each of
the routers, servers in the lab, using either telnet or ssh. You can use Putty for ssh
or telnet client. Each participant need prepare a laptop connect to the lab by
wireless.
3
1. Lab diagram:
Gi2
Gi1
Router 4 .2 .1 Router 3
AS 3
AS 4 eBGP
Loopback 0: 3.3.3.3/24
Loopback 0:
.1 IPv6:2001:DC34::/64 .2 2001:2003::1/48
4.4.4.4/24 Router
Gi1 1GGi Router 1Gi2
IPv4:192.168.34.0/24
2001:2001::3/48
IPv4:192.168.23.0/24
IPv6:2001:DC23::/64
IPv4:192.168.41.0/24
IPv6:2001:DC41::/64
telnet ipv6/ipv6
Enable password: ipv6
eBGP
eBGP
Gi2 Gi1
Gi1
.2 .1
IPv6:2001:DC12::/64 .2 .1
IPv4:192.168.12.0/24 Gi2
Router 1 Router 2
AS 1 eBGP
AS 2
Loopback 0: 1.1.1.1/24 Loopback 0: 2.2.2.2/24
Router 1GGi Router 1
Gi1
2001:2001::1/48 2001:2002::1/48
Lab
IPv6:2001:DC1::/64
IPv4:192.168.1.0/24
Router management ip
SWITCH
Gi3 Router 1: 192.168.1.1
Gi3 Router 2:192.168.1.2
Gi3 Router 3: 192.168.1.3
Gi3 Router 4: 192.168.1.4 .....
Dual Stack IPv4/IPv6
PC1 => PC10
2. Lab Rule
4
- These are not just rules designed to make your life miserable, but failure to
comply might mean you lose access to the labs, thus ending your practice session
5
2 Router 2 o Interface 1:
ASN 2 - IPv6: 2001:dc23::1/64
- IPv4: 192.168.23.1/24
o Interface 2:
- IPv6: 2001:dc12::2/64
- IPv4: 192.168.12.2/24
o Interface 3: Management
- IPv6: 2001:dc1::2/64 Interface
- IPv4: 192.168.1.2/24
o Interface lo: Loop back
- IPv6: 2001:2002::1/128 address
- IPv4: 2.2.2.2/32
3 Router 3 o Interface 1:
ASN 3 - IPv6: 2001:dc34::1/64
- IPv4: 192.168.34.1/24
o Interface 2:
- IPv6: 2001:dc23::2/64
- IPv4: 192.168.23.2/24
o Interface 3: Management
- IPv6: 2001:dc1::3/64 Interface
- IPv4: 192.168.1.3/24
o Interface lo: Loop back
- IPv6: 2001:2003::1/128 address
- IPv4: 3.3.3.3/32
6
4 Router 4 o Interface 1:
ASN 4 - IPv6: 2001:dc41::1/64
- IPv4: 192.168.41.1/24
o Interface 2:
- IPv6: 2001:dc34::2/64
- IPv4: 192.168.34.2/24
o Interface 3: Management
- IPv6: 2001:dc1::4/64 Interface
- IPv4: 192.168.1.4/24
o Interface lo: Loop back
- IPv6: 2001:2004::1/128 address
- IPv4: 4.4.4.4/32
5 Wireless 1 SSID: IPv6-LAB-1
Password:ipv6@2018
7
II. Practical scenarios
1. Exercise 1: Configure IPv6 address
9
1.2. Configure DHCPv6 on windows server 2012
These are the steps necessary to add the DHCP server role to a Windows Server 2012
computer:
Step 5: On the Select server roles page, select the DHCP Server check box.
11
Step 6: In the Add Roles and Features Wizard, click Add Features, and then click Next.
12
Step 7: On the Select features page, click Next.
13
Step 10: On the Installation progress page, wait until the Installation succeeds.
Once the installation completes, you can proceed to authorize the DHCP server or start
configuring the DHCP scopes.
A standalone (no domain member) Windows Server 2012 DHCP server can detect an
authorized DHCP server in a domain. When that happens, the standalone DHCP server
does not lease IP addresses and shuts down automatically.
Step 11: On the DHCP Server console, right click IPv6 and select New Scope.
Step 12: On the Welcome to the New Scope Wizard, click Next
15
Step 13: On the Scope Name, enter Name and Description information.
16
Step 14: On the Scope Prefix, enter the corresponding prefix for your IPv6 network. If
you have multiple DHCPv6 servers, the preference value can be modified to indicate
your priority among the servers. The lower this value, the higher the priority.
Step 15:On the Add Exclusions, enter any IPv6 address that belongs to that scope but
has been manually assigned to other devices in the network. This includes the IPv6
address that is manually configured on the DHCPv6 server itself. Additional exclusion
can be added after the initial DHCPv6 scope has been configured.
17
Step 16: On the Scope Lease, configure two settings:
Preferred Life Time is the length of time that a valid IPv6 address is preferred. When this time
expires, the address becomes deprecated but it is still valid.
Valid Life Time is the length of time that an IPv6 is in the valid state. The address becomes
invalid after the valid life time expires. The valid life rime must be equal or greater than the
preferred life time.
18
As on IPv4 scopes, you can configure exclusions, reservations, and DHCP options on
IPv6 scopes. However, DHCPv6 clients do not use their MAC addresses when contacting
a DHCP server. Instead a device unique identifier (DUID) is used by clients to get an IP
address from a DHCPv6 server.
You can disable SLAAC in windows ( open “cmd” with “run as administrator”)
>netsh interface
20
netsh interface>show interface
netsh interface ipv6 add route ::/0 "Local Area Connection" 2001:dcx::1
21
Ipconfig /all
The interface ID (the last 64 bits of a unicast IPv6 address) can be:
Randomly-generated
RFC 3041 defines temporary IPv6 addresses, which use a randomly generated
interface ID and a relatively short valid lifetime. Temporary IPv6 addresses are
typically used by client applications when initiating communication, such as a
Web browser, and are not registered in DNS. Public IPv6 addresses are typically
used by server applications for incoming connections, such as a Web server, and
are registered in DNS. Public IPv6 addresses can have randomly generated or
EUI-64-based interface IDs.
Or all interfaces
net.ipv6.conf.all.accept_ra = 0
23
net.ipv6.conf.default.accept_ra = 0
Thêm lệnh vào trong file /etc/sysconfig/network
NETWORKING_IPV6=yes
IPV6_AUTOCONF=no
# vi /etc/sysconfig/network
NETWORKING_IPV6=yes
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
IPV6INIT=yes
IPV6ADDR=<IPv6-IP-Address>
IPV6_DEFAULTGW=<IPv6-IP-Gateway-Address>
Example
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
HWADDR=00:30:48:33:bc:33
IPADDR=192.168.1.10
GATEWAY=192.168.1.1
NETMASK=255.255.255.0
IPV6INIT=yes
IPV6ADDR=2001:DC1::10/64
IPV6_DEFAULTGW=2001:DC1::1
24
Save and close the file. Restart networking:
$ ifconfig –a
# mii-tool- eth0
#ethtool eth0
#cat /sys/class/net/eth0/operstate
#ifconfig eth0
25
Verify IPv6 routing table
$ ping6 2001:DC1::1
26
2. Exercise 2: IPv4/IPv6 Dual stack + multihoming
Router 1
R1(config)#interface gigabitethernet 1
R1(config-if)#ipv6 enable
R1(config)#interface gigabitethernet 2
R1(config-if)#ipv6 enable
R1(config)#interface gigabitethernet 3
R1(config-if)#ipv6 enable
Configure Interface
R1(config)#interface loopback 0
loopback
27
R1(config-if)#ipv6 enable
R1(config-if)#no shut
R1(config)#router bgp 1
R1(config)#router bgp 1
R1(config-router)#address-family ipv6
R1(config-router)#address-family ipv6
R1(config-router-af)#network 2001:2001::/48
7 Annouce IPv6 prefix
R4(config-router)#address-family ipv4
28
255.255.255.0
Router 2
R2(config)#interface gigabitethernet 1
R2(config-if)#ipv6 enable
R2(config)#interface gigabitethernet 2
R2(config-if)#ipv6 enable
R2(config)#interface gigabitethernet 3
29
R2(config-if)#ip address 192.168.1.2 255.255.255.0
R2(config)#interface loopback 0
R2(config-if)#ipv6 enable
Configure Interface
4 R2(config-if)#ipv6 address 2001:2002::1/128
loopback
R2(config-if)#ip address 2.2.2.2 255.255.255.255
R2(config-if)#no shut
R2(config)#router bgp 2
R2(config-router)#address-family ipv6
R2(config-router-af)#network 2001:2002::/48
7 Annouce IPv6 prefix
R2(config-router-af)#network 2.2.2.0 mask
30
255.255.255.0
Router 3
R3(config)#interface gigabitethernet 1
R3(config-if)#ipv6 enable
R3(config)#interface gigabitethernet 2
R3(config-if)#ipv6 enable
R3(config)#interface gigabitethernet 3
31
R3(config-if)#ip address 192.168.1.3 255.255.255.0
R3(config)#interface loopback 0
R3(config)#router bgp 3
R3(config-router)#address-family ipv6
R3(config-router)#address-family ipv6
7 Annouce IP prefixes
R3(config-router-af)#network 2001:2003::/48
32
R3(config-router)#address-family ipv4
Router 4
R4(config)#interface gigabitethernet 1
R4(config-if)#ipv6 enable
R4(config)#interface gigabitethernet 2
R4(config-if)#ipv6 enable
R4(config)#interface gigabitethernet 3
4 Configure Interface 3
R4(config-if)#ipv6 enable
33
R4(config-if)#ipv6 address 2001:DC1::4/64
R4(config)#interface loopback 0
R4(config)#router bgp 4
R4(config-router)#address-family ipv6
34
R4(config-router-af)#network 2001:2004::/48
R4(config-router)#address-family ipv4
Sử dụng local preference để thực thi chính sách cho các route tương ứng
R1:
35
TT Description
Command
R1(config)#router bgp 1
R1(config)#address-family ipv4
set local-preference 0
Policy BGP prefixes using !
1
route-map
Ip prefix-list as3-ipv4-prefixes permit 3.3.3.0/24
R1(config)#router bgp 1
36
Match ip address prefix-list ipv6remain
Set local-perference 0
Kiểm tra tính khả thi chính sách định tuyến bằng lệnh show ip bgp, show bgp ipv6
unicast.
37
3. Exercise 3: Enable IPv6 on DNS System with BIND
Scenario: In this lab, the whole system has been set up and running on IPv4, using Bind
software running on Centos.
+ Each trainees will manage one zone: hvxx.labipv6.vn, where xx is the student number.
From the client machine, which installed the Secure Shell Client software.
The trainees ssh to the server with the assigned address, using the root account and
password provided.
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
Step 2: Edit the xx information of the zone hvxx.labipv6.vn in the named.conf file
according to the number of the students: For example, the student’s number is 01, you
have to changed to hv01.labipv6.vn.
(Record the lines which be editted)
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
38
Step 4: Use the mv command to change the file name /etc/named/db.hvxx.labipv6.vn
into the corresponding file in the order number of the student.
(Record results)
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
Step 6: Check the data file for the hvxx.labipv6.vn zone on the system.
(Record results)
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
Step 8: Query the DNS server (according to the IPv4 address of the server) to see if the
server responds to the domain name query hvxx.labipv6.vn.
(Record results)
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
Case 2: Configure the DNS server to listen for queries on the IPv6 interface.
39
Step 1: Configuration allows the DNS server to listen for queries on the IPv6 address
interface by adding the following line to the option of the named.conf file.
listen-on-v6 {any; };
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
Step 4: Query the DNS server (at the IPv6 address of the server) to see if the server is
listening and responding to queries via IPv6.
(Record results)
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
40
Step 1: Use the vi command to add a record to the end of /var/named/db.hvxx.labipv6.vn
Note 1: Must have “.” after the domain name to indicate that the domain is full
Note 2: each time change the zone file, have to increase the serial.
Step 2: Check the data file for the hvxx.labipv6.vn zone on the system.
(Record results)
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
Step 4: Query the DNS server with the domain name www.hvxx.labipv6.vn and record
type AAAA to check the results.
(Record results)
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
41
LAB DNS GUIDE
Step 2: Edit the xx information of the zone hvxx.labipv6.vn in the named.conf file
according to the number of the students: For example, the student’s number is 01, you
have to changed to hv01.labipv6.vn.
(Record the lines which be editted)
zone "." IN {
type hint;
file "db.cache";
};
zone "hv01.labipv6.vn." IN {
type master;
file "db.hv01.labipv6.vn";
};
[root@localhost ~]#
42
Step 3: Check if the configuration file named.conf is properly structured.
(Record results)
43
5400; minimum negative ttl
);
IN NS dns-dc01.hv01.labipv6.vn.
$ORIGIN hv01.labipv6.vn.
dns-dc01 IN A 192.168.1.100
www IN A 192.168.1.100
Step 6: Check the data file for the hvxx.labipv6.vn zone on the system.
(Record results)
[root@localhost ~]# /usr/local/sbin/named-checkzone hv01.labipv6.vn /var/named/db.hv01.labipv6.vn
OK
[root@localhost ~]#
(Record results)
Step 8: Query the DNS server (according to the IPv4 address of the server) to see if the
server responds to the domain name query hvxx.labipv6.vn.
(Record results)
44
; <<>> DiG 9.10.2-P4 <<>> @192.168.1.10 www.hvxx.labipv6.vn +norec
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35342
;; flags: qr aa ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.hvxx.labipv6.vn. IN A
;; ANSWER SECTION:
www.hvxx.labipv6.vn. 86400 IN A 192.168.1.100
;; AUTHORITY SECTION:
hvxx.labipv6.vn. 86400 IN NS dns-dcxx.hvxx.labipv6.vn.
;; ADDITIONAL SECTION:
dns-dcxx.hvxx.labipv6.vn. 86400 IN A 192.168.1.100
[root@localhost ~]#
Case 2: Configure the DNS server to listen for queries on the IPv6 interface.
Step 1: Configuration allows the DNS server to listen for queries on the IPv6 address
interface by adding the following line to the option of the named.conf file.
listen-on-v6 {any; };
45
Content after adding
options {
directory "/var/named";
pid-file "/var/run-named/named.pid";
version "not currently available";
listen-on {any; };
listen-on-v6 {any; };
allow-recursion {127.0.0.1; any; };
allow-query {any; };
};
Step 4: Query the DNS server (at the IPv6 address of the server) to see if the server is
listening and responding to queries via IPv6.
(Record results)
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.hvxx.labipv6.vn. IN A
;; ANSWER SECTION:
www.hvxx.labipv6.vn. 86400 IN A 192.168.1.100
;; AUTHORITY SECTION:
hvxx.labipv6.vn. 86400 IN NS dns-dcxx.hvxx.labipv6.vn.
;; ADDITIONAL SECTION:
dns-dcxx.hvxx.labipv6.vn. 86400 IN A 192.168.1.100
[root@localhost ~]#
47
In the zone data file /var/named/db.hvxx.labipv6.vn of the zone hvxx.labipv6.vn
Note 1: Must have “.” after the domain name to indicate that the domain is full
Note 2: each time change the zone file, have to increase the serial.
Step 2: Check the data file for the hvxx.labipv6.vn zone on the system.
(Record results)
[root@localhost ~]# /usr/local/sbin/named-checkzone hv01.labipv6.vn /var/named/db.hv01.labipv6.vn
OK
[root@localhost ~]#
Step 4: Query the DNS server with the domain name www.hvxx.labipv6.vn and record
type AAAA to check the results.
(Record results)
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.hvxx.labipv6.vn. IN AAAA
;; ANSWER SECTION:
www.hvxx.labipv6.vn. 86400 IN AAAA 2001:dc1::10
;; AUTHORITY SECTION:
hvxx.labipv6.vn. 86400 IN NS dns-dcxx.hvxx.labipv6.vn.
;; ADDITIONAL SECTION:
dns-dcxx.hvxx.labipv6.vn. 86400 IN A 192.168.1.100
49
;; Query time: 0 msec
;; SERVER: 192.168.1.10#53(192.168.1.10)
;; WHEN: Sat Apr 22 00:58:04 ICT 2017
;; MSG SIZE rcvd: 115
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.hvxx.labipv6.vn. IN AAAA
;; ANSWER SECTION:
www.hvxx.labipv6.vn. 86400 IN AAAA 2001:dc1::10
;; AUTHORITY SECTION:
hvxx.labipv6.vn. 86400 IN NS dns-dcxx.hvxx.labipv6.vn.
;; ADDITIONAL SECTION:
dns-dcxx.hvxx.labipv6.vn. 86400 IN A 192.168.1.100
[root@localhost named]#
50
51
4. Exercise 4: Enable IPv6 in Apache
www.hvxx.labipv6.vn1 : 192.168.x.x
www.hvxx.labipv6.vn1 : 2001:DCx::x
Setup Apache :
# vi /etc/httpd.conf
Listen 192.168.x.x:80
Listen [2001:dcx::x]:80
52
# vi /etc/sysconfig/ip6tables
53
III. Appendix
1. How to Use the vi Editor
The vi editor is available on almost all Unix systems. vi can be used from any type of
terminal because it does not depend on arrow keys and function keys--it uses the standard
alphabetic keys for commands.
vi (pronounced "vee-eye") is short for "vi"sual editor. It displays a window into the file
being edited that shows 24 lines of text. vi is a text editor, not a "what you see is what
you get" word processor. vi lets you add, change, and delete text, but does not provide
such formatting capabilities as centering lines or indenting paragraphs.
- elementary editing
Starting vi
vi filename
where "filename" is the name of the existing file. If the file is not in your current
directory, you must use the full pathname.Or you may create a new file by typing
vi newname
where "newname" is the name you wish to give the new file. To open a new file called
"testvi," enter
vi testvi
On-screen, you will see blank lines, each with a tilde (~) at the left, and a line at the
bottom giving the name and status of the new file:
54
vi has two modes:
- command mode
- insert mode
In command mode, the letters of the keyboard perform editing functions (like moving the
cursor, deleting text, etc.). To enter command mode, press the escape <Esc> key.
In insert mode, the letters you type form words and sentences. Unlike many word
processors, vi starts up in command mode.
Entering Text
In order to begin entering text in this empty file, you must change from command mode
to insert mode. To do this, type i
Nothing appears to change, but you are now in insert mode and can begin typing text. In
general, vi's commands do not display on the screen and do not require the Return key to
be pressed.
Type a few short lines and press <Return> at the end of each line. If you type a long line,
you will notice the vi does not word wrap, it merely breaks the line unceremoniously at
the edge of the screen.
If you make a mistake, pressing <Backspace> or <Delete> may remove the error,
depending on your terminal type.
To move the cursor to another position, you must be in command mode. If you have just
finished typing text, you are still in insert mode. Go back to command mode by pressing
<Esc>. If you are not sure which mode you are in, press <Esc> once or twice until you
hear a beep. When you hear the beep, you are in command mode.
--- ---------------
55
j down one line
k up one line
When you have gone as far as possible in one direction, the cursor stops moving and you
hear a beep. For example, you cannot use l to move right and wrap around to the next
line, you must use j to move down a line. See the section entitled "Moving Around in a
File" for ways to move more quickly through a file.
Basic Editing
Editing commands require that you be command mode. Many of the editing commands
have a different function depending on whether they are typed as upper- or lowercase.
Often, editing commands can be preceded by a number to indicate a repetition of the
command.
Deleting Characters
To delete a character from a file, move the cursor until it is on the incorrect letter, then
type
The character under the cursor disappears. To remove four characters (the one under the
cursor and the next three) type
4x
X (uppercase)
Deleting Words
To delete a word, move the cursor to the first letter of the word, and type
dw
This command deletes the word and the space following it.
56
3dw
Deleting Lines
dd
The cursor does not have to be at the beginning of the line. Typing dd deletes the entire
line containing the cursor and places the cursor at the start of the next line. To delete two
lines, type
2dd
To delete from the cursor position to the end of the line, type
D (uppercase)
Replacing Characters
Type r
The new character will appear, and you will still be in command mode.
Replacing Words
To replace one word with another, move to the start of the incorrect word and type
cw
The last letter of the word to be replaced will turn into a $. You are now in insert mode
and may type the replacement. The new text does not need to be the same length as the
original. Press <Esc> to get back to command mode. To replace three words, type
3cw
Replacing Lines
To change text from the cursor position to the end of the line:
57
Type C (uppercase).
Press <Esc>.
Inserting Text
Type i
Appending Text
Type a
o (lowercase)
O (uppercase)
58
Joining Lines
Type J
Type 3J
Undoing
U (uppercase)
Undoing all edits on a single line only works as long as the cursor stays on that line. Once
you move the cursor off a line, you cannot use U to restore the line.
There are shortcuts to move more quickly though a file. All these work in command
mode.
Key Movement
--- --------
$ to end of line
59
M to middle line of screen
Moving by Searching
Type / (slash).
Press <Return>.
With vi, you edit a copy of the file, rather than the original file. Changes are made to the
original only when you save your edits.
ZZ
60
The vi editor editor is built on an earler Unix text editor called ex. ex commands can be
used within vi. ex commands begin with a : (colon) and end with a <Return>. The
command is displayed on the status line as you type. Some ex commands are useful when
saving and closing files.
To save the edits you have made, but leave vi running and your file open:
Press <Esc>.
Type :w
Press <Return>.
To quit vi, and discard any changes your have made since last saving:
Press <Esc>.
Type :q!
Press <Return>.
Command Summary
STARTING vi
ENTERING TEXT
k up one line
61
BASIC EDITING
x delete character
nx delete n characters
dw delete word
dd delete line
cw replace a word
62
b backward word by word
$ to end of line
:w save file
https://support.microsoft.com/en-us/kb/2478747
https://support.microsoft.com/vi-vn/help/929852/how-to-disable-ipv6-or-its-components-
in-windows
https://supportforums.cisco.com/document/97766/comparing-ospfv3-ospfv2-routing-
protocol
64