一:概述:
隧道技术提供了一种以现有IPv4路由体系来传递IPv6数据的方法:将IPv6的分组作为无结构意义的数据,封装在IPv4数据报中,被IPv4网络传输。根据建立方式的不同,隧道可以分成两类:(手工)配置的隧道和自动配置的隧道。隧道技术巧妙地利用了现有的IPv4网络,它的意义在于提供了一种使 IPv6的节点之间能够在过渡期间通信的方法,但它并不能解决IPv6节点与IPv4节点之间相互通信的问题。
二:实验拓扑:
R1(s2/1)-(s2/1)R2(s2/2)-(s2/1)R3(s2/2)-(s2/1)R4
4台路由,R1,R4运行IPV6
R2,R3半边运行IPV4,半边运行IPV6
三:配置信息
R1#
ipv6 unicast-routing //开启IPV6单播路由功能
interface Loopback0
ip address 1.1.1.1 255.255.255.0 //配置环回接口做为它的router-id
interface Serial2/1
ipv6 address 12::1/64 //IPV6地址
ipv6 ospf 1 area 0 //接口下启用ospf
R2#
ipv6 unicast-routing
interface Serial2/1
ipv6 address 12::2/64
ipv6 ospf 1 area 0
interface Serial2/2
ip address 23.0.0.2 255.255.255.0
interface Tunnel0 //在s2/1接口下打隧道
ipv6 address 10::1/64 //给隧道配置IPV6地址
ipv6 ospf 1 area 0 //启用ospf
tunnel source Serial2/2 //申明隧道源端
tunnel destination 23.0.0.3 //申明隧道目的端
tunnel mode ipv6ip //隧道模式是ipv6到ipv4
R3#
ipv6 unicast-routing
interface Serial2/1
ip address 23.0.0.3 255.255.255.0
interface Serial2/2
ipv6 address 34::3/64
ipv6 ospf 1 area 0
interface Tunnel0
ipv6 address 10::2/64
ipv6 ospf 1 area 0
tunnel source Serial2/1
tunnel destination 23.0.0.2
tunnel mode ipv6ip
R4#
ipv6 unicast-routing
interface Loopback0
ip address 4.4.4.4 255.255.255.0
interface Serial2/1
ipv6 address 34::4/64
ipv6 ospf 1 area 0
四:调试信息
R1#show ipv6 route
IPv6 Routing Table - 6 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
O 10::/64 [110/11175]
via FE80::C838:AFF:FE24:0, Serial2/1
C 12::/64 [0/0]
via ::, Serial2/1
L 12::1/128 [0/0]
via ::, Serial2/1
O 23::/64 [110/11239] //用隧道模式学习到了隔着ipv4网络的远端ipv6路由
via FE80::C838:AFF:FE24:0, Serial2/1
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0
R2#show ipv6 route
IPv6 Routing Table - 7 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
C 10::/64 [0/0]
via ::, Tunnel0
L 10::1/128 [0/0]
via ::, Tunnel0
C 12::/64 [0/0]
via ::, Serial2/1
L 12::2/128 [0/0]
via ::, Serial2/1
O 23::/64 [110/11175]
via FE80::1700:3, Tunnel0
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0
R1#ping 23::4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 23::4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 344/380/420 ms
R1#tr
R1#traceroute 23::4
Type escape sequence to abort.
Tracing the route to 23::4
1 12::2 132 msec 84 msec 104 msec
2 10::2 240 msec 352 msec 104 msec
//^-^看到是杂过去的了吧?发到ipv6的源端地址上走隧道过去的
3 23::4 332 msec 388 msec 356 msec
R1#ping 23.0.0.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 23.0.0.3, timeout is 2 seconds:
.... //注意这里不通
Success rate is 0 percent (0/4)
R1#show ip route
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
R1#tr
R1#traceroute 23.0.0.3
Type escape sequence to abort.
Tracing the route to 23.0.0.3
1 * * *
2 * * *
3 * * *
4 * * *
5 * * *
6 * * *
//traceroute也无路可走
//这是ipv6想与ipv4通信,说明它们无法通信.
所以隧道技术并不能解决IPv6节点与IPv4节点之间相互通信的问题。
责任编辑:小草