实验目的:
通过IPv4地址建立隧道,实现IPv6地址的互联互通
实验环境:
R1-R3均使用Router
实验过程
规划拓扑图
规划IP地址
R1:
Ethernet0/0/0 10.1.10.1/24
Ethernet0/0/1 3003::1/64
Tunnel0/0/1 3001::1/64
R2:
Ethernet0/0/0 10.1.10.2/24
Ethernet0/0/1 10.1.20.2/24
R3:
Ethernet0/0/0 10.1.20.3/24
Ethernet0/0/1 3002::1/64
Tunnel0/0/1 3001::2/64
配置IP地址
[R1]interface Ethernet0/0/0
[R1-Ethernet0/0/0] ip address 10.1.10.1 255.255.255.0
[R1-Ethernet0/0/1]quit
[R1]ipv6
[R1]interface Ethernet0/0/1
[R1-Ethernet0/0/1] ipv6 enable
[R1-Ethernet0/0/1] ipv6 address 3003::1/64
[R1-Ethernet0/0/1]interface Tunnel0/0/1
[R1-Tunnel0/0/1] ipv6 enable
[R1-Tunnel0/0/1] ipv6 address 3001::1/64
[R2]interface Ethernet0/0/0
[R2-Ethernet0/0/0] ip address 10.1.10.2 255.255.255.0
[R2-Ethernet0/0/0]interface Ethernet0/0/1
[R2-Ethernet0/0/1] ip address 10.1.20.2 255.255.255.0
[R3]ipv6
[R3]interface Ethernet0/0/0
[R3-Ethernet0/0/0] ip address 10.1.20.3 255.255.255.0
[R3-Ethernet0/0/0]interface Ethernet0/0/1
[R3-Ethernet0/0/1] ipv6 enable
[R3-Ethernet0/0/1] ipv6 address 3002::1/64
[R3-Ethernet0/0/1]interface Tunnel0/0/1
[R3-Tunnel0/0/1] ipv6 enable
[R3-Tunnel0/0/1] ipv6 address 3001::2/64
配置静态路由使IPv4地址互通
[R1]ip route-static 10.1.20.0 255.255.255.0 10.1.10.2
[R3]ip route-static 10.1.10.0 255.255.255.0 10.1.20.2
[R3]ping 10.1.10.1
PING 10.1.10.1: 56 data bytes, press CTRL_C to break
Reply from 10.1.10.1: bytes=56 Sequence=1 ttl=254 time=230 ms
Reply from 10.1.10.1: bytes=56 Sequence=2 ttl=254 time=70 ms
Reply from 10.1.10.1: bytes=56 Sequence=3 ttl=254 time=140 ms
Reply from 10.1.10.1: bytes=56 Sequence=4 ttl=254 time=60 ms
Reply from 10.1.10.1: bytes=56 Sequence=5 ttl=254 time=90 ms
--- 10.1.10.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 60/118/230 ms
配置手动隧道
[R1]interface Tunnel0/0/1
[R1-Tunnel0/0/1] tunnel-protocol ipv6-ipv4
#设置类型为ipv6-ipv4手动隧道
[R1-Tunnel0/0/1] source Ethernet0/0/0
#选择出接口为Ethernet0/0/0
[R1-Tunnel0/0/1] destination 10.1.20.3
#指定隧道对端的IPv4地址
[R3]interface Tunnel0/0/1
[R3-Tunnel0/0/1] tunnel-protocol ipv6-ipv4
[R3-Tunnel0/0/1] source Ethernet0/0/0
[R3-Tunnel0/0/1] destination 10.1.10.1
配置IPv6静态路由使接口互通
[R1]ipv6 route-static :: 0 Tunnel0/0/1
[R3]ipv6 route-static :: 0 Tunnel0/0/1
[R3]ping ipv6 -a 3001::2 3001::1
PING 3001::1 : 56 data bytes, press CTRL_C to break
Reply from 3001::1
bytes=56 Sequence=1 hop limit=64 time = 60 ms
Reply from 3001::1
bytes=56 Sequence=2 hop limit=64 time = 30 ms
Reply from 3001::1
bytes=56 Sequence=3 hop limit=64 time = 80 ms
Reply from 3001::1
bytes=56 Sequence=4 hop limit=64 time = 60 ms
Reply from 3001::1
bytes=56 Sequence=5 hop limit=64 time = 70 ms
--- 3001::1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/60/80 ms