隧道6in4 和隧道6to4(GNS3)


隧道6in4實驗配置

拓撲圖

 

Device

Interface

IP Address(IPv6)

R1

F 0/0

10.1.81.1

F 0/1

2001:db8:cafe:81::10

R2

F 0/0

10.81.1.2

F 0/1

172.81.1.2

R3

F 0/0

172.81.1.3

F 0/1

2001:DB8:ACE:81::20

R4

F 0/0

2001:db8:cafe:81::40

R5

F 0/0

2001:DB8:ACE:81::50

 

手工隧道是雙向點到點隧道,但兩台邊界路由器之間的純IPv4網絡不必是點到點網絡,且IPv4網絡一定要ping通,手工隧道可以用靜態路由或者動態路由,我這里使用ospf動態路由配置。

R1與R3同理

R1(config)#int f 0/0

R1(config-if)#ip add 10.81.1.1 255.255.255.0

R1(config-if)#ip ospf 1 area 0

R1(config-if)#no shut

R1(config-if)#int lo0

R1(config-if)#ip add 1.1.1.1 255.255.255.255

R1(config-if)#ip ospf 1 area 0

R1(config-if)#ex

R1(config)#router ospf 1

R1(config-rtr)#router-id 1.1.1.1

R1(config-rtr)#network 1.1.1.1 0.0.0.0 area 0

R1(config-rtr)#network 10.81.1.0 0.0.0.255 area 0

 

R2(config)#int f 0/0

R2(config-if)#ip add 10.81.1.2 255.255.255.0

R2(config-if)#ip ospf 1 area 0

R2(config-if)#no shut

R2(config-if)#int f 0/1

R2(config-if)#ip add 172.81.1.2 255.255.255.0

R2(config-if)#ip ospf 1 area 0

R2(config-if)#no shut

 

R2(config-if)#int lo0

R2(config-if)#ip add 2.2.2.2 255.255.255.255

R2(config-if)#ip ospf 1 area 0

R2(config-if)#ex

R2(config)#router ospf 1

R2(config-rtr)#router-id 2.2.2.2

R2(config-rtr)#network 2.2.2.2 0.0.0.0 area 0

R2(config-rtr)#network 10.81.1.0 0.0.0.255 area 0

R2(config-rtr)#network 172.81.1.0 0.0.0.255 area 0

 

查看R1路由表,驗證ospf是否配置成功

 

 

 

Ospf配置完成后去邊界路由配置隧道

R1與R3同理

R1(config)#ipv6 unicast-routing

R1(config)#int f 0/1

R1(config-if)#ipv6 enable

R1(config-if)#ipv6 add 2001:db8:café:81::10/64

R1(config-if)#no shut

R1(config-if)#int tunnel 0

R1(config-if)#ipv6 enable

R1(config-if)#tunnel source f 0/0

R1(config-if)#tunnel mode ipv6ip

R1(config-if)#tunnel destination 172.81.1.3

R1(config-if)#exit

R1(config)#ipv6 route 2001:db8:cafe::/48 tunnel 0

 

 

 

 

配置完R3后試ping R1 f0/1接口

 

 

 

 

最后配置R4(R5同理)

R4(config)#ipv6 unicast-routing

R4(config)#int f 0/0

R4(config-if)#ipv6 enable

R4(config-if)#ipv6 add 2001:db8:cafe:81::40/64

R4(config-if)#no shut

R4(config-if)#ex

R4(config)#ipv6 route ::0/0 2001:db8:café:81::10

 

配置完R5后,從R4ping到 R5

 

 

 

從R5 ping 到 R4

 

 

隧道配置完成。

 

 

 

6to4隧道配置

拓撲圖

 

Device

Interface

IP Address(IPv6)

R1

F 0/0

172.10.81.1

F 0/1

2002:AC0A:5101::1

R2

F 0/0

10.81.1.1

F 0/1

2002:A01:5101::1

R3

F 0/0

218.224.81.1

F 0/1

2002:DAE0:5101::1

R4

F 0/0

172.10.81.4

F 0/1

10.1.81.4

F 1/0

218.224.81.4

R5

F 0/0

2002:AC0A:5101::5

R6

F 0/0

2002:A01:5101::6

R5

F 0/0

2002:DAE0:5101::7

 

6to4隧道內部路由只能配置靜態路由

R1(config)#int f 0/0

R1(config-if)#ip add 172.10.81.1 255.255.255.0

R1(config-if)#no shut

R1(config-if)#ex

R1(config)#ip route 10.1.81.0 255.255.255.0 172.10.81.4

R1(config)#ip route 218.224.81.0 255.255.255.0 172.10.81.4

 

R2(config)#int f 0/0

R2(config-if)#ip add 10.1.81.1 255.255.255.0

R2(config-if)#no shut

R2(config-if)#ex

R2(config)#ip route 172.10.81.0 255.255.255.0 10.1.81.4

R2(config)#ip route 218.224.81.0 255.255.255.0 10.1.81.4

 

R3(config)#int f 0/0

R3(config-if)#ip add 218.224.81.1 255.255.255.0

R3(config-if)#no shut

R3(config-if)#ex

R3(config)#ip route 10.1.81.0 255.255.255.0 218.224.81.4

R3(config)#ip route 172.10.81.0 255.255.255.0 218.224.81.4

 

R4(config)#int f 0/0

R4(config-if)#ip add 172.10.81.4 255.255.255.0

R4(config-if)#no shut

R4(config-if)#int f 0/1

R4(config-if)#ip add 10.1.81.4 255.255.255.0

R4(config-if)#no shut

R4(config-if)#int f 1/0

R4(config-if)#ip add 218.224.81.4 255.255.255.0

R4(config-if)#no shut

 

靜態路由配置完成,show路由表驗證

 

 

試從R1ping到R3、R4

 

 

 

繼續配置隧道

R2、R3配置與R1同理

R1(config)#ipv6 unicast-routing

R1(config)#int f 0/1

R1(config-if)#ipv6 enable

R1(config-if)#ipv6 add 2002:ac0a:5101::1/48

R1(config-if)#no shut

R1(config-if)#int tunnel 0

R1(config-if)#ipv6 enable

R1(config-if)#tunnel source f 0/0

R1(config-if)#tunnel mode ipv6ip 6to 4

R1(config-if)#exit

R1(config)#ipv6 route 2002::/16 tunnel 0

 

配置完后從R1ping到R2、R3

 

 

 

最后配置R5(R6、R7同理)

R5(config)#ipv6 unicast-routing

R5(config)#int f 0/0

R5(config-if)#ipv6 enable

R5(config-if)#ipv6 add 2002:ac0a:5101::5/48

R5(config-if)#no shut

R5(config-if)#ex

R5(config)#ipv6 route ::0/0 2002:ac0a:5101::1

 

配置完成R6、R7后,試從R5ping 通 R6、R7

 

 

6to4隧道實驗完成

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM