又说HUB-SPOKE,这个拓扑模型真是有够经典的,在FR中,如何跑RIP,EIGRP,OSPF,各个路由协议的小特性曾经让我很是头疼,尤其是OSPF哪种网络类型选邻居哪种选DR,怎一个乱字了得,之后在DM×××中也用了这种拓扑,学习起来的时候就轻松多了,跟FR很像。MPLS中也有这种拓扑,今天就研究下。

其实很久以前就做过这个实验,当时没觉得有什么特别的地方,做过后就没怎么放在心上。上个星期看cisco的文档,发现这个拓扑清晰明白,于是就做一下当作复习。不想这个实验一做就是一个多星期,直到上个星期五才搞定!

没有学到什么新东西,但是发现了cisco的文档的一个命令让我很迷惑,这个命令以前我也不能确定是不是错误,配不配好像都行。好在那段时间我的模拟器出了bug,实验怎么敲都不行,我以为自己的MPLS学的很有问题,急的赶紧翻以前的资料复习敲实验。结果发现配不配差别很大。

我们在hub端配置的两个VRF,从spoke端接收路由的那个vrfFROM-SPOKE)用不用配置RD?cisco的文档里没有配,但是我做实验的时候就必须配,如果不配的话,在PE1-AS1show run的时候就会发现一个很严重的问题:FROM-SPOKE地址族消失!

这个实验模拟跨越一个ISP,一个公司的总部和两个分部间建立MPLS ×××PE-CE间运行BGP,同时分部运行在同一个私有AS内。分部的路由通信和数据通信都要通过总部向下分发,这就是hub-spoke拓扑的最重要的特征。

实现这中拓扑的关键就是对BGP环路预防机制造成的路由拒绝如何解决,本实验中用到了两个技术:as-overrideallowas-in


拓扑:


    说明:1.绿色线条说明了数据包的路由走向。

                     2.HUB端为CE1-A,SPOKE端为CE2-A和CE3-A。

                     3.PE1-AS1作为接入HUB的PE,与CE1-A建立了两条链路。一条作为导入路由,一条作为导出路由。

基本配置

CE1-A:


hostname CE1-A


ip cef

!

interface Loopback0

 ip address 172.16.10.1 255.255.255.0   #模拟总部内网

!

interface FastEthernet0/0.14     #接入HUB端PE的FROM-SPOKE,从SPOKE接收路由

 encapsulation dot1Q 14

 ip address 14.1.1.1 255.255.255.0

!

interface FastEthernet0/0.41      #接入HUB端PE的FROM-HUB,向HUB传递路由

 encapsulation dot1Q 41

 ip address 41.1.1.1 255.255.255.0

!

router bgp 65123

 no synchronization

 bgp router-id 1.1.1.1

 bgp log-neighbor-changes

 network 172.16.10.0 mask 255.255.255.0

 neighbor 14.1.1.4 remote-as 1             #PE-CE间运行BGP,与HUB建立两个邻居关系

 neighbor 41.1.1.4 remote-as 1

 no auto-summary

!


CE2-A:


hostname CE2-A


ip cef

!

interface Loopback0

 ip address 172.16.20.1 255.255.255.0

!

interface FastEthernet0/0.25    #接入SPOKE端PE2-AS1的×××-A

 encapsulation dot1Q 25

 ip address 25.1.1.2 255.255.255.0

!

router bgp 65123

 no synchronization

 bgp router-id 2.2.2.2

 bgp log-neighbor-changes

 network 172.16.20.0 mask 255.255.255.0

 neighbor 25.1.1.5 remote-as 1

 no auto-summary

 

CE3-A:


hostname CE3-A


ip cef

!

interface Loopback0

 ip address 172.16.30.1 255.255.255.0

!

interface FastEthernet0/0.36          #接入SPOKE端PE3-AS1的×××-A

 encapsulation dot1Q 36

 ip address 36.1.1.3 255.255.255.0

!

router bgp 65123

 no synchronization

 bgp router-id 3.3.3.3

 bgp log-neighbor-changes

 network 172.16.30.0 mask 255.255.255.0

 neighbor 36.1.1.6 remote-as 1

 no auto-summary

      

 

PE1-AS1:


hostname PE1-AS1


ip cef

!

ip vrf FROM-HUB       #用于向SPOKE传递路由

 rd 1:456

 route-target export 1:456     #只需配置export的RT,作为SPOKE端VRF的入口RT

!

ip vrf FROM-SPOKE    #用于从SPOKE接受路由

 rd 1:4               #这个RD一定要配

 route-target import 1:5         #只需配置import的RT,这两个RT是spoke的出口RT

 route-target import 1:6

!

mpls label range 400 499

mpls label protocol ldp

!

interface Loopback0

 ip address 4.4.4.4 255.255.255.255

!

interface FastEthernet0/0

 no ip address

 duplex auto

 speed auto

!

interface FastEthernet0/0.14

 encapsulation dot1Q 14

 ip vrf forwarding FROM-SPOKE

 ip address 14.1.1.4 255.255.255.0

!

interface FastEthernet0/0.41

 encapsulation dot1Q 41

 ip vrf forwarding FROM-HUB

 ip address 41.1.1.4 255.255.255.0

!

interface FastEthernet0/0.45

 encapsulation dot1Q 45

 ip address 45.1.1.4 255.255.255.0

 ip router isis

 mpls ldp discovery transport-address interface

 mpls ip

 isis circuit-type level-2-only

!

interface FastEthernet0/0.46

 encapsulation dot1Q 46

 ip address 46.1.1.4 255.255.255.0

 ip router isis

 mpls ldp discovery transport-address interface

 mpls ip

 isis circuit-type level-2-only      

!

router isis

 net 47.4560.0000.0004.00

 is-type level-2-only

 metric-style wide

 passive-interface Loopback0

!

router bgp 1

 bgp router-id 4.4.4.4

 no bgp default ipv4-unicast

 bgp log-neighbor-changes

 neighbor rr peer-group      #RR在这里的作用不是反射路由,主要是为了节省CPU负载。可不配。

 neighbor rr remote-as 1

 neighbor rr update-source Loopback0

 neighbor 5.5.5.5 peer-group rr

 neighbor 6.6.6.6 peer-group rr

 !

 address-family ***v4

 neighbor rr send-community extended

 neighbor rr route-reflector-client

 neighbor 5.5.5.5 activate

 neighbor 6.6.6.6 activate

 exit-address-family

 !

 address-family ipv4 vrf FROM-SPOKE

 neighbor 14.1.1.1 remote-as 65123          #PE-CE间运行BGP

 neighbor 14.1.1.1 activate   

 no synchronization

 exit-address-family

 !

 address-family ipv4 vrf FROM-HUB

 neighbor 41.1.1.1 remote-as 65123

 neighbor 41.1.1.1 activate

 no synchronization

 exit-address-family

!

mpls ldp router-id Loopback0 force


 

PE2-AS1:


hostname PE2-AS1


ip cef

!

ip vrf ×××-A

 rd 1:5

 route-target export 1:5

 route-target import 1:456    #import是HUB的出口RT,一定不能写错

!

mpls label range 500 599

mpls label protocol ldp

!

interface Loopback0

 ip address 5.5.5.5 255.255.255.255

!

interface FastEthernet0/0

 no ip address

 duplex auto

 speed auto

!

interface FastEthernet0/0.25

 encapsulation dot1Q 25

 ip vrf forwarding ×××-A

 ip address 25.1.1.5 255.255.255.0

!

interface FastEthernet0/0.45

 encapsulation dot1Q 45

 ip address 45.1.1.5 255.255.255.0

 ip router isis

 mpls ldp discovery transport-address interface

 mpls ip

 isis circuit-type level-2-only

!

router isis

 net 47.4560.0000.0005.00

 is-type level-2-only

 metric-style wide

 passive-interface Loopback0

!

router bgp 1

 bgp router-id 5.5.5.5

 no bgp default ipv4-unicast

 bgp log-neighbor-changes

 neighbor 4.4.4.4 remote-as 1

 neighbor 4.4.4.4 update-source Loopback0

 !

 address-family ***v4

 neighbor 4.4.4.4 activate

 neighbor 4.4.4.4 send-community extended

 exit-address-family

 !

 address-family ipv4 vrf ×××-A

 neighbor 25.1.1.2 remote-as 65123

 neighbor 25.1.1.2 activate

 no synchronization

 exit-address-family

!

mpls ldp router-id Loopback0 force


 

PE3-AS1:


hostname PE3-AS1


ip cef

!

ip vrf ×××-A

 rd 1:6

 route-target export 1:6

 route-target import 1:456

!

mpls label range 600 699

mpls label protocol ldp

!

interface Loopback0

 ip address 6.6.6.6 255.255.255.255

!

interface FastEthernet0/0

 no ip address

 duplex auto

 speed auto

!

interface FastEthernet0/0.36

 encapsulation dot1Q 36

 ip vrf forwarding ×××-A

 ip address 36.1.1.6 255.255.255.0

!

interface FastEthernet0/0.46

 encapsulation dot1Q 46

 ip address 46.1.1.6 255.255.255.0

 ip router isis

 mpls ldp discovery transport-address interface

 mpls ip

 isis circuit-type level-2-only

!

router isis

 net 47.4560.0000.0006.00

 is-type level-2-only

 metric-style wide

 passive-interface Loopback0

!

router bgp 1

 bgp router-id 6.6.6.6

 no bgp default ipv4-unicast

 bgp log-neighbor-changes

 neighbor 4.4.4.4 remote-as 1

 neighbor 4.4.4.4 update-source Loopback0

 !

 address-family ***v4

 neighbor 4.4.4.4 activate

 neighbor 4.4.4.4 send-community extended

 exit-address-family

 !

 address-family ipv4 vrf ×××-A

 neighbor 36.1.1.3 remote-as 65123

 neighbor 36.1.1.3 activate

 no synchronization

 exit-address-family

!

mpls ldp router-id Loopback0 force

基本配置部分完成。

下转路由调试部分http://edges.blog.51cto.com/705035/423011