發布時間: 2017-06-16 14:59:26
這個小實驗的要求很簡單,實現的原理也很清晰。6to4通道相比之于配置隧道的有點就是自動建立隧道。通過特殊的編址,他能夠從ipv6目的地址中提取出ipv4地址作為目的地址然后在ipv4網絡上進行路由,這樣就不用靜態設置通道的目的地址了,確實節省了很多管理開銷。需要注意的地方:
(1) ipv6網絡里的使用的地址必須是2002::/16的前綴,這是尋址的需要,因為建立6to4通道的路由器之間沒有運行Ipv6 IGP路由協議,所有路由還是要靠靜態,那么,前綴編編制就必須是2002::/16的形式,否則無法路由。Ipv6網絡里的前綴要一致,要不然是肯定要出問題的。
(2) tunnel口無需設置目的地址,這是因為通道是一對多的形式,尋址是依靠特殊的編制地址來實現的,2002:xxxx:xxxx::/48內嵌的ipv4地址能夠提取自動提取出來然后通過Ipv4域來路由到另一個通道終點。因此編制很重要,必須與通道的源地址對應起來,此外還留有16位的子網位,因此地址分配的空間還是很充足的。
(3) 關于tunnel的源地址,我個人覺得用環回口地址是比較好的,這樣還可以提供一定的線路冗余(聯想bgp對等體建立)。但是一定要跟ipv6地址做好映射,形成該ipv6網絡的/48的前綴,這是6to4能否成功的關鍵!
(4) Tunnel可以不需要Ipv6的地址的,但是必須支持Ipv6地址。通道建立之后,在6to4路由器上建立一個靜態路由指向tunnel,然后重發布此路由到自己的ipv6網絡。(ipv6 route 2002::/16 tunnel x)
下面給出了配置。
R1:
ipv6 unicast-routing
!
interface Loopback0
ip address 12.1.1.1 255.255.255.0
ip ospf network point-to-point
!
interface Tunnel0
no ip address
no ip redirects
ipv6 unnumbered Serial1/0
ipv6 enable
tunnel source Loopback0
tunnel mode ipv6ip 6to4
!
interface Serial1/0
no ip address
ipv6 address 2002:C01:101:1::1/128
ipv6 ospf 10 area 0
serial restart-delay 0
! !
router ospf 10
router-id 1.1.1.1
log-adjacency-changes
passive-interface Loopback0
network 1.1.1.0 0.0.0.255 area 0
network 12.1.1.0 0.0.0.255 area 0
network 13.1.1.0 0.0.0.255 area 0
!
ipv6 route 2002:2301:101::/48 Tunnel0
ipv6 router ospf 10
router-id 1.1.1.1
log-adjacency-changes
redistribute static
!
R2:
ipv6 unicast-routing
!
interface Loopback0
no ip address
ipv6 address 2002:C01:101:2::1/128
ipv6 ospf network point-to-point
ipv6 ospf 10 area 0
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial1/0
no ip address
ipv6 address 2002:C01:101:1::2/128
ipv6 ospf 10 area 0
serial restart-delay 0
!
ipv6 router ospf 10
router-id 2.2.2.2
log-adjacency-changes
R3:
ipv6 unicast-routing
!
interface Loopback0
ip address 35.1.1.1 255.255.255.0
ip ospf network point-to-point
!
interface Tunnel0
no ip address
no ip redirects
ipv6 unnumbered Serial1/2
ipv6 enable
tunnel source Loopback0
tunnel mode ipv6ip 6to4
!
interface Serial1/1
ip address 13.1.1.3 255.255.255.0
serial restart-delay 0
!
interface Serial1/2
no ip address
ipv6 address 2002:2301:101:1::3/128
ipv6 ospf 10 area 0
serial restart-delay 0
!
router ospf 10
router-id 3.3.3.3
log-adjacency-changes
passive-interface Loopback0
network 3.3.3.0 0.0.0.255 area 0
network 13.1.1.0 0.0.0.255 area 0
network 35.1.1.0 0.0.0.255 area 0
!
ip classless
!
ip http server
no ip http secure-server
!
ipv6 route 2002:C01:101::/48 Tunnel0
ipv6 router ospf 10
router-id 3.3.3.3
log-adjacency-changes
redistribute static
!
R5:
ipv6 unicast-routing
!
interface Loopback0
no ip address
ipv6 address 2002:2301:101:2::1/128
ipv6 ospf network point-to-point
ipv6 ospf 10 area 0
!
interface Serial1/2
no ip address
ipv6 address 2002:2301:101:1::5/128
ipv6 ospf 10 area 0
serial restart-delay 0
!!
ip http server
no ip http secure-server
!
ipv6 router ospf 10
router-id 5.5.5.5
log-adjacency-changes
passive-interface Loopback0
上一篇: OSPF與ISIS比較
下一篇: IPv6基礎淺談