IPv6 手工tunnel和自動tunnel

IPv6 手工tunnel和自動tunnel
12.2.1 IPv4向IPv6過渡理論基礎
隧道技術在CCIE考試中常常涉及,因此在BGP這個章節咱們增長了相關的隧道技術
雙棧(ipv4和ipv6同時運行)是ipv6 tunnel的前提,因此雙棧技術也是一種過渡技術。IPv6手動tunnel和自動tunnel是IPv4向IPv6過渡的重要工具
 手動tunnel把ipv6封裝到IPv4包內,支持任意的路由協議
 自動tunnel(6to4 tunnel)經過計算把IPv6地址內嵌到IPv6地址,不支持動態路由協議,支持靜態路由
12.2.2 實驗拓撲描述
13.IPv6 手工tunnel和自動tunnel
如圖11-14所示,R2和R3各自有直連地址23.1.1.x/24和環回口22.1.1.1,33.1.1.1,IPv6的直連地址爲20XY::X/64好比R1的e0/1=2012::1/64,環回口爲20XX::X/128,如2011::1/128
圖12-2 向IPv6過渡的隧道技術
12.2.3 IPv6隧道技術實現
一、啓用雙棧(既運行IPv4也運行IPv6),並在R2和R3之間運行任意的IPv4路由協議
咱們選擇eigrp,使得二者的環回口相互可達,參考命令:
R2R2#ping 33.1.1.1 source 22.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 33.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 22.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/41/60 ms
router eigrp 100
network 22.1.1.1 0.0.0.0
network 23.1.1.2 0.0.0.0
no auto-summary

運行IPv6
R2(config)#ipv6 unicast-routing
二、創建手動tunnel,並運行路由協議
R2(config)#interface tunnel 1
R2(config-if)# tunnel source Loopback0
R2(config-if)# tunnel destination 33.1.1.1
R2(config-if)# tunnel mode ipv6ip
R2(config-if)# ipv6 address 2023::2/64
R2(config-if)# ipv6 ospf 1 area 0---賦予IPv6地址並運行動態路由協議

R3:
R3(config)#interface tunnel 1
R3(config-if)# tunnel source Loopback0
R3(config-if)# tunnel destination 22.1.1.1
R3(config-if)# tunnel mode ipv6ip
R3(config-if)# ipv6 enable
R3(config-if)# ipv6 ospf 1 area 0ide

同時請在R1和R4運行OSPFv3,R2鏈接R1的接口以及R3鏈接R4的接口運行OSPFv3,此步驟僅僅以R4爲例,請自行完成其餘:
R4(config)#ipv6 unicast-routing
R4(config)#int lo0
R4(config-if)#ip add 4.4.4.4 255.255.255.255
R4(config-if)#ipv6 address 2044::4/128
R4(config-if)#int e0/1
R4(config-if)#no shut
R4(config-if)#ipv6 address 2034::4/64
R4(config-if)#ipv6 ospf 1 area 0
R4#show ipv6 route ospf
IPv6 Routing Table - 8 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 2011::1/128 [110/11131]
via FE80::CE02:57FF:FE20:1, Ethernet0/1
O 2012::/64 [110/11131]
via FE80::CE02:57FF:FE20:1, Ethernet0/1
O 2023::/64 [110/22232]
via FE80::CE02:57FF:FE20:1, Ethernet0/1
R4#ping 2011::1工具

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2011::1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 108/150/216 ms
三、自動tunnel(6to4 tunnel)
自動tunnel不支持動態路由協議,不能配置tunnel的Destination,因此去掉以前相關的配置
R3(config)#int tunnel 1
R3(config-if)#no ipv6 ospf 1 area 0
R3(config-if)#no tunnel destination
R3(config-if)#tunnel mode ipv6ip 6to4---把模式改成自動tunnel
接下來須要計算tunnel的地址,該地址以2002開始,接下來的32位是十進制的ipv4地址轉換爲16進制的IPv6地址,R2的tunnel的IPv6地址有22.1.1.1轉換而來,那麼22=16,1=01,則轉換後的地址爲2002:1601:0101::/64;33.1.1.1轉換完以後爲33=21,則最終=2002:2101:101::/64
R3(config-if)#ipv6 address 2002:2101:101::3/64
因爲不支持動態路由協議,咱們來寫一條靜態去往2002::/16位的前綴
R3(config)#ipv6 route 2002::/16 tunnel 1

R2的配置:
interface Tunnel1
no ip address
no ip redirects
ipv6 address 2002:1601:101::2/64
tunnel source Loopback0
tunnel mode ipv6ip 6to4
ipv6 route 2002::/16 tunnel 1
測試
R2#ping 2002:2101:101::3oop

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2002:2101:101::3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/37/88 ms
查看tunnel的狀況:
R2#show interfaces tunnel 1
Tunnel1 is up, line protocol is up
Hardware is Tunnel
MTU 1514 bytes, BW 9 Kbit, DLY 500000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation TUNNEL, loopback not set
Keepalive not set
Tunnel source 22.1.1.1 (Loopback0), destination UNKNOWN
Tunnel protocol/transport IPv6 6to4測試

Fast tunneling enabled
Tunnel transmit bandwidth 8000 (kbps)
Tunnel receive bandwidth 8000 (kbps)
可是如今R1不能和R4通訊,由於R1和R4沒有對端的路由(有ospfv3的鄰居)
R4#show ipv6 ospf neighbor orm

Neighbor ID Pri State Dead Time Interface ID Interface
33.1.1.1 1 FULL/DR 00:00:39 5 Ethernet0/1router

R4#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 2033::3/128 [110/10]
via FE80::CE02:57FF:FE20:1, Ethernet0/1
C 2034::/64 [0/0]
via ::, Ethernet0/1
L 2034::4/128 [0/0]
via ::, Ethernet0/1
LC 2044::4/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 ::/0 2002:2101:101::3

R3(config)#ipv6 route ::/0 2002:1601:101::2
若是採用OSPFv3,那麼能夠在R2和R3上產生一條默認路由
R3(config)#ipv6 router ospf 1
R3(config-rtr)#default-information originate always
!
R2(config)#ipv6 router ospf 1
R2(config-rtr)#default-information originate always
R4#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
OE2 ::/0 [110/1], tag 1
via FE80::CE02:57FF:FE20:1, Ethernet0/1
O 2033::3/128 [110/10]
via FE80::CE02:57FF:FE20:1, Ethernet0/1
C 2034::/64 [0/0]
via ::, Ethernet0/1
L 2034::4/128 [0/0]
via ::, Ethernet0/1
LC 2044::4/128 [0/0]
via ::, Loopback0
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0
R4#ping 2011::1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2011::1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/66/132 ms
實驗完成blog

相關文章
相關標籤/搜索