实验目的:
通过IPv4地址建立隧道,实现IPv6地址的互联互通
实验环境:
R1、R2使用Router,交换机使用S5700
实验过程
规划拓扑图
规划IP地址
R1:
GigabitEthernet 0/0/0 10.0.12.1
Tunnel0/0/1 ::10.0.12.1/64
R2:
GigabitEthernet 0/0/0 10.0.12.2
Tunnel0/0/1 ::10.0.12.2/64
配置IP地址
[R1]ipv6
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 10.0.12.1 24
[R1]interface Tunnel 0/0/1
[R1-Tunnel0/0/1]ipv6 enable
[R2-Tunnel0/0/1]ipv6 address ::10.0.12.1/64
[R2]ipv6
[R2]interface GigabitEthernet0/0/0
[R2-GigabitEthernet0/0/0] ip address 10.0.12.2 255.255.255.0
[R2-GigabitEthernet0/0/1]interface Tunnel0/0/1
[R2-Tunnel0/0/1] ipv6 enable
[R2-Tunnel0/0/1]ipv6 address ::10.0.12.2/64
ping测试IPv4地址连通性
[R1]ping 10.0.12.2
PING 10.0.12.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=220 ms
Reply from 10.0.12.2: bytes=56 Sequence=2 ttl=255 time=60 ms
Reply from 10.0.12.2: bytes=56 Sequence=3 ttl=255 time=40 ms
Reply from 10.0.12.2: bytes=56 Sequence=4 ttl=255 time=40 ms
Reply from 10.0.12.2: bytes=56 Sequence=5 ttl=255 time=50 ms
--- 10.0.12.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/82/220 ms
配置自动隧道
[R1]interface Tunnel 0/0/1
[R1-Tunnel0/0/1]tunnel-protocol ipv6-ipv4 auto-tunnel
#配置隧道类型为自动隧道
[R1-Tunnel0/0/1]source GigabitEthernet 0/0/0
#配置出接口
[R2]interface Tunnel 0/0/1
[R2-Tunnel0/0/1] tunnel-protocol ipv6-ipv4 auto-tunnel
[R2-Tunnel0/0/1] source GigabitEthernet0/0/0
配置IPv6静态路由使接口互通
[R1]ipv6 route-static :: 0 Tunnel 0/0/1
[R2]ipv6 route-static :: 0 Tunnel0/0/1
ping测试
[R2]ping ipv6 ::10.0.12.1
PING ::10.0.12.1 : 56 data bytes, press CTRL_C to break
Reply from ::10.0.12.1
bytes=56 Sequence=1 hop limit=64 time = 30 ms
Reply from ::10.0.12.1
bytes=56 Sequence=2 hop limit=64 time = 30 ms
Reply from ::10.0.12.1
bytes=56 Sequence=3 hop limit=64 time = 50 ms
Reply from ::10.0.12.1
bytes=56 Sequence=4 hop limit=64 time = 50 ms
Reply from ::10.0.12.1
bytes=56 Sequence=5 hop limit=64 time = 40 ms
--- ::10.0.12.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/40/50 ms