[转] IPV4上建立IPV6隧道以及IPV6上建立IPV4隧道

https://blog.csdn.net/chiyuwei1766/article/details/48211023

实验目录:

1)在IPV4中穿越IPV6。

2)有IPV6中穿越IPV4。

实验配置:

1)各接口IP配置如上,且在R5、R2、R3、R4的ipv6接口上都配置有ripng路由协议(注意关闭水平分割)。R2、R3都有指向公网的默认路由。

1.1、实验拓扑:

1.2、在IPv4中穿越ipv6,建立隧道如下

R2#sh run

interface Tunnel2

 no ip address
 ipv6 address 21::1/64    \tunnel隧道接口IP类型为ipv6,表明隧道所封装的原始IP数据流为ipv6。
 ipv6 rip ripng_1 enable
 tunnel source 1.1.1.2
 tunnel destination 2.2.2.2

R3#sh run

interface Tunnel3
 no ip address
 ipv6 address 31::1/64
 ipv6 rip ripng_1 enable
 tunnel source 2.2.2.2
 tunnel destination 1.1.1.2

1.3、查看路由表及测试连通性

R2(config-if)#do sh ipv rou
IPv6 Routing Table – 9 entries
Codes: C – Connected, L – Local, S – Static, R – RIP, B – BGP
       U – Per-user Static route, M – MIPv6
       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
       D – EIGRP, EX – EIGRP external
C   20::/64 [0/0]
     via ::, Serial1/3
L   20::1/128 [0/0]
     via ::, Serial1/3
C   21::/64 [0/0]
     via ::, Tunnel2
L   21::1/128 [0/0]
     via ::, Tunnel2
R   30::/64 [120/2]
     via FE80::C602:22FF:FE9C:0, Tunnel2   \路由表中出现R3的tunnel接口路由,说明隧道已通。
R   31::/64 [120/2]
     via FE80::C602:22FF:FE9C:0, Tunnel2
R   40::/64 [120/3]
     via FE80::C602:22FF:FE9C:0, Tunnel2
R   50::/64 [120/2]
     via FE80::CA04:2BFF:FEC0:0, Serial1/3
L   FF00::/8 [0/0]
     via ::, Null0
R2(config-if)#

R2(config-if)# do ping 40::1 sou 20::1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 40::1, timeout is 2 seconds:
Packet sent with a source address of 20::1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/63/80 ms
R2(config-if)#

表明隧道建立成功。IPV6成功穿越IPV4。

2)在IPV6中穿越IPV4。由上面的配置结果知道,在R5与R4之间已经实现IPV6的通讯,所以下面的实验是在R5与R4通讯的IPV6中穿越IPV4。

2.1、实验拓扑:

2.2、在1)最后配置的基础上再添加如上配置。

R5#sh run

interface Tunnel5

 ip address 10.10.10.1 255.255.255.252      
 tunnel source 50::1
 tunnel destination 40::1
 tunnel mode gre ipv6      \必须将tunnel模式设置为gre ipv6,因为tunnle隧道的source、destination地址为ipv6。
!

R4(config-if)# do sh run

interface Tunnel4
 ip address 10.10.10.2 255.255.255.252
 tunnel source 40::1
 tunnel destination 50::1
 tunnel mode gre ipv6

测试隧道建立情况

R5(config)#do ping 10.10.10.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 68/108/184 ms
R5(config)#

表明隧道建立成功,IPV4数据流可以穿越IPV6。

关于xmsg

技术面前人人平等.同时技术也不分高低贵贱.正所谓学无大小,达者为尊.
此条目发表在未分类分类目录。将固定链接加入收藏夹。