Network Requirements
- IPv6 Network1 and IPv6 Network2 are the private IPv6 network of Device1 and Device3 respectively.
- IPv6 Network1 and IPv6 Network2 communicate via the IPv6 tunnel between Device1 and Device3.
Network Topology
Figure 12-2 Networking for Configuring the basic functions of IPv6 tunnel
Configuration Steps
Step 1: Configure the IP address of the interface (omitted).
Step 2: Configure OSPFv3, making Device1, Device2, and Device3 communicate with each other.
#Configure Device1.
Device1#configure terminal
Device1(config)#ipv6 router ospf 100
Device1(config-ospf6)#router-id 1.1.75.1
Device1(config-ospf6)#exit
Device1(config)#interface vlan1
Device1(config-if-vlan1)#ipv6 router ospf tag 100 area 0
Device1(config-if-vlan1)#exit
|
#Configure Device2.
Device2#configure terminal
Device2(config)#ipv6 router ospf 100
Device2(config-ospf6)#router-id 1.2.75.1
Device2(config-ospf6)#exit
Device2(config)#interface vlan1
Device2(config-if-vlan1)#ipv6 router ospf tag 100 area 0
Device2(config-if-vlan1)#exit
Device2(config)#interface vlan2
Device2(config-if-vlan2)#ipv6 router ospf tag 100 area 0
Device2(config-if- vlan2)#exit
|
#Configure Device3.
Device3#configure terminal
Device3(config)#ipv6 router ospf 100
Device3(config-ospf6)#router-id 1.1.73.1
Device3(config-ospf6)#exit
Device3(config)#interface vlan2
Device3(config-if-vlan2)#ipv6 router ospf tag 100 area 0
Device3(config-if-vlan2)#exit
|
#Query the IPv6 route table of Device3.
Device3#show ipv6 route
Codes: C - Connected, L - Local, S - static, R - RIP, B - BGP, i-ISIS
U - Per-user Static route
O - OSPF, OE-OSPF External, M - Management
L ::1/128 [0/0]
via ::, 6w0d:23:09:31, lo0
O 2001:1::/64 [110/2]
via fe80::508b:fff:fee4:ff6, 00:08:37, vlan2
C 2001:2::/64 [0/0]
via ::, 00:15:51, vlan2
L 2001:2::2/128 [0/0]
via ::, 00:15:50, lo0
C 3002::/64 [0/0]
via ::, 00:15:06, vlan4
L 3002::1/128 [0/0]
via ::, 00:15:04, lo0
- The querying methods of Device1 and Device2 are the same as that of Device3, so the querying process is omitted.
Step 3: Configure the IPv6 tunnel.
#On Device1, configure IPv6 tunnel tunnel1, the source address is 2001:1::1, the destination address is 2001:2::2, IP address is 10.0.0.1, and the IPv6 address is 10::1.
Device1(config)#interface tunnel 1
Device1(config-if-tunnel1)#tunnel mode ipv6ipv6
Device1(config-if-tunnel1)#tunnel source 2001:1::1
Device1(config-if-tunnel1)#tunnel destination 2001:2::2
Device1(config-if-tunnel1)#ip address 10.0.0.1 255.255.255.0
Device1(config-if-tunnel1)#ipv6 address 10::1/64
Device1(config-if-tunnel1)#exit
|
#On Device3, configure IPv6 tunnel tunnel1, the source address is 2001:2::2, the destination address is 2001:1::1, IP address is 10.0.0.2, and the IPv6 address is 10::2.
Device3(config)#interface tunnel 1
Device3(config-if-tunnel1)#tunnel mode ipv6ipv6
Device3(config-if-tunnel1)#tunnel source 2001:2::2
Device3(config-if-tunnel1)#tunnel destination 2001:1::1
Device3(config-if-tunnel1)#ip address 10.0.0.2 255.255.255.0
Device3(config-if-tunnel1)#ipv6 address 10::2/64
Device3(config-if-tunnel1)#exit
|
#Query the IPv6 tunnel information of Device3.
Device3#show tunnel 1 Tunnel 1:
Tunnel mode is ipv6ipv6
Source ipv6 address is 2001:2::2(Source ipv6 address is up on source interface vlan2)
Destination ipv6 address is 2001:1::1
Tunnel state is up
Encapsulation vrf is global(0x0)
TTL(time-to-live) is 255
TOS(type of service) is not set
total(1)
-
The querying method of Device1is the same as that of Device3, so the querying process is omitted.
- When the tunnel is not in the same network segment, it is necessary to configure the static route to the peer tunnel on the devices at both ends of the tunnel, and the output interface is the tunnel interface.
Step 4: Configure the static route.
#On Device1, configure the static route to IPv6 Network2 with the egress interface tunnel1.
Device1(config)#ipv6 route 3002::/64 tunnel1
|
#On Device3, configure the static route to IPv6 Network1 with the egress interface tunnel1.
Device3(config)# ipv6 route 3001::/64 tunnel1
|
#Query the IPv6 route table of Device3.
Device3#show ipv6 route
Codes: C - Connected, L - Local, S - static, R - RIP, B - BGP, i-ISIS
U - Per-user Static route
O - OSPF, OE-OSPF External, M - Management
L ::1/128 [0/0]
via ::, 6w0d:23:50:28, lo0
C 10::/64 [0/0]
via ::, 00:12:23, tunnel1
L 10::2/128 [0/0]
via ::, 00:12:22, lo0
O 2001:1::/64 [110/2]
via fe80::508b:fff:fee4:ff6, 00:49:34, vlan2
C 2001:2::/64 [0/0]
via ::, 00:56:48, vlan2
L 2001:2::2/128 [0/0]
via ::, 00:56:46, lo0
S 3001::/64 [1/100000]
via ::, 00:00:14, tunnel1
C 3002::/64 [0/0]
via ::, 00:56:02, vlan4
L 3002::1/128 [0/0]
via ::, 00:56:01, lo0
-
The querying method of Device1 is the same as that of Device3, so the querying process is omitted.