IPV4上建立IPV6隧道以及IPV6上建立IPV4隧道
實驗目錄:
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。