发布时间: 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比较
下一篇: 解析硬盘接口技术