实验目的
1、掌握6to4的隧道GRE配置方法.
实验拓扑
配置各台路由器的IPv4及IPv6地址,并使用ping命令测试IPv4网络的互通。同时为IPv4网络配置OSPF路由协议,保证IPv4网络可路由性。
R1(config)#ipv6 unicast-routing
R1(config)#interface f0/0
R1(config-if)#ip address 12.12.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#interface f0/1
R1(config-if)#ip address 13.13.13.1 255.255.255.0
R1(config-if)#no shutdown
R2(config)#ipv6 unicast-routing
R2(config)#interface f0/0
R2(config-if)#ip address 12.12.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config)#interface loopback 0
R2(config-if)#ipv6 address 2001:AB1:0:9::1/64
R2(config-if)#ipv6 address 2001:AB1:0:a::1/64
R2(config-if)#ipv6 address 2001:AB1:0:b::1/64
R2(config-if)#ipv6 address 2001:AB1:0:c::1/64
R3(config)#ipv6 unicast-routing
R3(config)#interface f0/1
R3(config-if)#ip address 13.13.13.3 255.255.255.0
R3(config-if)#no shutdown
R3(config)#interface loopback 0
R3(config-if)#ipv6 address 2001:AB1:0:3::1/64
R1(config)#router ospf 1
R1(config-router)#network 12.12.12.0 0.0.0.255 area 0
R1(config-router)#network 13.13.13.0 0.0.0.255 area 0
R2(config)#router ospf 1
R2(config-router)#network 12.12.12.0 0.0.0.255 area 0
R3(config)#router ospf 1
R3(config-router)#network 13.13.13.0 0.0.0.255 area 0
检测网络联通性
R3#ping 12.12.12.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.12.12.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/11/12 ms
在R2上配置GRE隧道,用于解决IPv6网络相互访问需求,配置如下:
R2(config)#interface tunnel 1
R2(config-if)#ipv6 address 2001:ab1:0:2::1/64
R2(config-if)#tunnel source 12.12.12.2
R2(config-if)#tunnel destination 13.13.13.3
R2(config-if)#tunnel mode ipv6ip
R2(config-if)#no shutdown
R3(config)#interface tunnel 1
R3(config-if)#ipv6 address 2001:ab1:0:2::2/64
R3(config-if)#tunnel source f0/1
//也可以采用本地端口标识隧道源
R3(config-if)#tunnel destination 12.12.12.1
R3(config-if)#tunnel mode ipv6ip
R3(config-if)#no shutdown
在R2或R3上使用ping命令测试隧道的配置:
R2#ping 2001:ab1:0:2::2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:AB1:0:2::2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/36/48 ms
查看R3路由表:
R3#show ipv6 route
C 2001:AB1:0:2::/64 [0/0]
via ::, Tunnel1
L 2001:AB1:0:2::2/128 [0/0]
via ::, Tunnel1
//此路由指出可以通过隧道直接到达R2路由器。
C 2001:AB1:0:3::/64 [0/0]
via ::, Loopback0
L 2001:AB1:0:3::1/128 [0/0]
via ::, Loopback0
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0
根据R2与R3的路由表显示,继续配置如下静态路由:
R2(config)#ipv6 route 2001:ab1:0:3::/64 2001:ab1:0:2::2
R2(config)#ipv6 route ::/0 2001:ab1:0:2::2
R3(config)#ipv6 route ::/0 2001:ab1:0:2::1
在R2或R3上使用ping命令,测试两端的IPv6网络是否可以正常访问:
R2#ping 2001:ab1:0:3::1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:AB1:0:3::1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/43/68 ms
R3#ping 2001:ab1:0:9::1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:AB1:0:9::1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/36/64 ms
R3#ping 2001:ab1:0:c::1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:AB1:0:C::1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/22/40 ms