多域mpls *** 類型C

跨域*** 組網-OptionC

組網需求

R1 和R6 屬於同一個***。R1 通過AS100 的R2 接入,R6 通過AS200 的R5 接入。採用OptionC 方式實現跨域的BGP/MPLS ***,即,採用PE 間通過Multi-hop MP-EBGP 發佈標籤***-IPv4 路由方式管理*** 路由。

配置思路大致如此:

1、先做通路由。在同一個AS內,先通過運行IGP做通AS內部路由,再在各PE路由器上運行BGP,宣告通過IGP學到的路由和直連路由。做完以後,可以在PE1(本實例中的R2)上PING通PE2(本實例中的R5)的L0接口和外部接口(F1/0)。

2、配置在各PE之間能夠交換帶標籤的IPV4路由。PE1(R2)與ASBR-PE1(R3)、PE2(R5)與ASBR-PE2(R4)、ASBR-PE1與ASBR-PE2

3、ASBR-PE在向本AS內的PE發佈路由時,將下一跳改爲自己

4、在ASBR-PE 上配置路由策略:對於從本AS 內的PE 接收的路由,在向對端AS的ASBR 發佈時,分配MPLS 標籤;對於向本AS 內的PE 發佈的路由,如果是帶標籤的IPv4 路由,爲其分配新的MPLS 標籤。

5、在PE與PE之間(R2與R5)建立鄰居關係,直接發佈***V4路由。所以在ASBR-PE上要有能夠支持帶標籤的IPV4路由的能力。(別忘了關閉默認的標籤過濾功能)。

 
 
 
 
r1#show  run

!

hostname r1      #用戶CE設備,和ISP的PE設備相連

!

no ip domain lookup

!

ip cef

!

interface Loopback0

 ip address 10.1.1.1 255.255.255.0 #模擬內網網段

!

interface FastEthernet0/0          # 內網出口接口,和ISP的PE相連  

 ip address 1.1.1.1 255.255.255.0

 duplex half

!

router bgp 1000                   #在CE上運行BGP,和相鄰的PE設備

 no synchronization                建立EBGP鄰居

 bgp log-neighbor-changes

 redistribute connected           #宣告直連網段

 neighbor 1.1.1.2 remote-as 100   #和相鄰的PE設備建立EBGP鄰居

 no auto-summary

!

ip classless

end

r2#show  run

hostname r2                #PE設備,是ISP和用戶相連的設備

!                           

no ip domain lookup

!

ip vrf ***                #創建一個VRF(***路由轉發),華爲稱作

 rd 100:1                 # ***實例,RD(路由標識符)

 route-target export 100:1  #路由目標,用於路由過濾

 route-target import 100:1

!

ip cef

!

interface Loopback0

 ip address 20.1.1.1 255.255.255.255   #注意子網掩碼爲4個255,防止路

!                                #由被聚合,LSP不能正確處理內層標籤

interface FastEthernet0/0        #在此接口上綁定VRF

 ip vrf forwarding ***           #先做這一步,再配置IP地址

 ip address 1.1.1.2 255.255.255.0

 duplex half

!

interface FastEthernet1/0

 ip address 2.1.1.1 255.255.255.0

 duplex half

 tag-switching ip               #配置MPLS能力

!

router ospf 1                   #運行OSPF 路由協議

 log-adjacency-changes

 network 2.1.1.1 0.0.0.0 area 0   #宣告

 network 20.1.1.1 0.0.0.0 area 0

!

router bgp 100                     #運行BGP路由協議,AS號爲100

 bgp log-neighbor-changes

 neighbor 30.1.1.1 remote-as 100   #和ASBR PE路由器建立鄰居關係

 neighbor 30.1.1.1 update-source Loopback0  

 neighbor 50.1.1.1 remote-as 200   #和另一個AS中的PE建產鄰居關係 

 neighbor 50.1.1.1 ebgp-multihop 10 #允許最大跳數爲10跳

 neighbor 50.1.1.1 update-source Loopback0

 !        

 address-family ipv4

 redistribute connected           #引入直連路由

 neighbor 30.1.1.1 activate       #激活鄰居(默認)

 neighbor 30.1.1.1 send-label     #配置相鄰設備支持帶標籤路由

 no neighbor 50.1.1.1 activate    #關閉默認的鄰居活躍狀態

 no auto-summary

 no synchronization

 exit-address-family

 !

 address-family ***v4

 neighbor 50.1.1.1 activate     #在此地址族下激活鄰居(CE2)

 neighbor 50.1.1.1 send-community extended   #發送***V4路由

 exit-address-family

 !

 address-family ipv4 vrf ***      #PE1和CE1建立EBGP鄰居關係

 redistribute connected            將學到的***路由引入到***V4

 neighbor 1.1.1.1 remote-as 1000   路由裏

 neighbor 1.1.1.1 activate

 no auto-summary

 no synchronization

 exit-address-family

!

ip classless

end

r3#show  run

hostname r3           #ISP自治系統邊界路由器,和另外一個AS的

!                      邊界路由器相連

no ip domain lookup

!

ip cef

!

interface Loopback0                 

 ip address 30.1.1.1 255.255.255.255 #注意子網掩碼爲4個255,防止路  

!                                #由被聚合,LSP不能正確處理內層標籤

interface FastEthernet0/0          #和另一個AS的ASBR路由器相連的

 ip address 3.1.1.1 255.255.255.0   接口,此接口不用使能MPLS

 duplex half                       

!

interface FastEthernet1/0          #和同一AS內的PE相連的接口,此

 ip address 2.1.1.2 255.255.255.0    接口需使能MPLS

 duplex half

 tag-switching ip

!

router ospf 1                     #運行OSPF協議

 log-adjacency-changes

 network 2.1.1.2 0.0.0.0 area 0

 network 30.1.1.1 0.0.0.0 area 0

!

router bgp 100                     #運行BGP協議,AS號爲100

 no bgp default route-target filter #關閉默認的路由標籤過濾功能

 bgp log-neighbor-changes

 neighbor 3.1.1.2 remote-as 200     #和相鄰AS的ASBR的PE建立鄰居  

 neighbor 20.1.1.1 remote-as 100    #和同AS內的PE建立鄰居

 neighbor 20.1.1.1 update-source Loopback0

 !

 address-family ipv4

 redistribute connected              #引入直連路由

 redistribute ospf 1                 #引入OSPF路由

 neighbor 3.1.1.2 activate           #激活鄰居

 neighbor 3.1.1.2 send-label         #配置相鄰設備支持帶標籤路由

 neighbor 3.1.1.2 route-map aa out   #在出方向上應用路由圖aa

 neighbor 20.1.1.1 activate          #激活鄰居

 neighbor 20.1.1.1 send-label        #配置相鄰設備支持帶標籤路由

 neighbor 20.1.1.1 next-hop-self     #更改下一跳爲自己

 neighbor 20.1.1.1 route-map bb out  #在出方向上應用路由圖bb

 no auto-summary

 no synchronization

 exit-address-family

!

ip classless

!

route-map aa permit 10     #創建路由圖aa,對於從本AS的PE接受的路由

 set mpls-label        在向對端AS的ASBR的PE發佈時,分配MPLS標籤

!

route-map bb permit 10   #創建路由圖bb,對於向本AS內發佈的路由,如果

 match mpls-label        是帶標籤的IPV4路由,爲其分配新的MPLS標籤

 set mpls-label

!

end

r4#show  run

hostname r4       #ISP自治系統邊界路由器,和另外一個AS的

!                  邊界路由器相連

no ip domain lookup

!

ip cef

!

interface Loopback0

 ip address 40.1.1.1 255.255.255.255 #注意子網掩碼爲4個255,防止路

!                            #由被聚合,LSP不能正確處理內層標籤

interface FastEthernet0/0     #和另一個AS的ASBR路由器相連的

 ip address 3.1.1.2 255.255.255.0 接口,此接口不用使能MPLS

 duplex half

!

interface FastEthernet1/0     #和同一AS內的PE相連的接口,此

 ip address 4.1.1.1 255.255.255.0 接口需使能MPLS

 duplex half

 tag-switching ip

!

router ospf 1                 #運行OSPF

 log-adjacency-changes

 network 4.1.1.1 0.0.0.0 area 0

 network 40.1.1.1 0.0.0.0 area 0

!

router bgp 200                 #運行BGP協議,AS號爲200

 no bgp default route-target filter#關閉默認的路由標籤過濾功能

 bgp log-neighbor-changes

 neighbor 3.1.1.1 remote-as 100    #和相鄰AS的ASBR的PE建立鄰居

 neighbor 50.1.1.1 remote-as 200   #和同AS內的PE建立鄰居

 neighbor 50.1.1.1 update-source Loopback0

 !

 address-family ipv4

 redistribute connected            #引入直連路由

 redistribute ospf 1               #引入OSPF路由

 neighbor 3.1.1.1 activate         #激活鄰居

 neighbor 3.1.1.1 send-label       #配置相鄰設備支持帶標籤路由

 neighbor 3.1.1.1 route-map aa out #在出方向上應用路由圖aa

 neighbor 50.1.1.1 activate        #激活鄰居

 neighbor 50.1.1.1 send-label      #配置相鄰設備支持帶標籤路由

 neighbor 50.1.1.1 next-hop-self   #更改下一跳爲自己

 neighbor 50.1.1.1 route-map cc out#在出方向上應用路由圖cc

 no auto-summary

 no synchronization

 exit-address-family

!

ip classless

!

route-map aa permit 10     #創建路由圖aa,對於從本AS的PE接受的路由

 set mpls-label         在向對端AS的ASBR的PE發佈時,分配MPLS標籤

!

route-map cc permit 10   #創建路由圖bb,對於向本AS內發佈的路由,如果

 match mpls-label          是帶標籤的IPV4路由,爲其分配新的MPLS標籤

 set mpls-label

!

End

r5#show  run          

hostname r5            #PE設備,是ISP和用戶相連的設備

!

no ip domain lookup

!

ip vrf ***              #創建一個VRF(***路由轉發)

 rd 200:1

 route-target export 100:1

 route-target import 100:1

!

ip cef

!

interface Loopback0

 ip address 50.1.1.1 255.255.255.255

!         

interface FastEthernet0/0  #在此接口綁定VRF(***實例)

 ip vrf forwarding ***    

 ip address 5.1.1.1 255.255.255.0

 duplex half

!

interface FastEthernet1/0

 ip address 4.1.1.2 255.255.255.0

 duplex half

 tag-switching ip             

!

router ospf 1

 log-adjacency-changes

 network 4.1.1.2 0.0.0.0 area 0

 network 50.1.1.1 0.0.0.0 area 0

!

router bgp 200                       #和R2上的基本原理一致

 bgp log-neighbor-changes   

 neighbor 20.1.1.1 remote-as 100

 neighbor 20.1.1.1 ebgp-multihop 10

 neighbor 20.1.1.1 update-source Loopback0

 neighbor 40.1.1.1 remote-as 200

 neighbor 40.1.1.1 update-source Loopback0

 !        

 address-family ipv4

 redistribute connected

 no neighbor 20.1.1.1 activate

 neighbor 40.1.1.1 activate

 neighbor 40.1.1.1 send-label

 no auto-summary

 no synchronization

 exit-address-family

 !

 address-family ***v4

 neighbor 20.1.1.1 activate

 neighbor 20.1.1.1 send-community extended

 exit-address-family

 !

 address-family ipv4 vrf ***

 redistribute connected

 neighbor 5.1.1.2 remote-as 2000

 neighbor 5.1.1.2 activate

 no auto-summary

 no synchronization

 exit-address-family

!

ip classless

End

r6#show run

hostname r6              #用戶CE設備,和ISP的PE設備相連

!

no ip domain lookup          

!

ip cef

!

interface Loopback0           #和R1上的基本原理一致

 ip address 60.1.1.1 255.255.255.0   

!

interface FastEthernet0/0

 ip address 5.1.1.2 255.255.255.0

 duplex half

!

interface FastEthernet1/0

 no ip address

 shutdown

 duplex half

!

router bgp 2000             #和R1上的基本原理一致

 no synchronization

 bgp log-neighbor-changes

 redistribute connected

 neighbor 5.1.1.1 remote-as 200

 no auto-summary

!

ip classless

End

 
 
 
r1#traceroute   

Protocol [ip]: 

Target IP address: 60.1.1.1

Source address: 

Numeric display [n]: 

Timeout in seconds [3]: 

Probe count [3]: 

Minimum Time to Live [1]: 

Maximum Time to Live [30]: 

Port Number [33434]: 

Loose, Strict, Record, Timestamp, Verbose[none]: 

Type escape sequence to abort.

Tracing the route to 60.1.1.1

  1 1.1.1.2 104 msec 124 msec 44 msec

  2 2.1.1.2 [MPLS: Labels 24/18 Exp 0] 252 msec 148 msec 200 msec

  3 3.1.1.2 [MPLS: Labels 16/18 Exp 0] 188 msec 172 msec 120 msec

  4 5.1.1.1 [AS 200] [MPLS: Label 18 Exp 0] 72 msec 208 msec 196 msec

  5 5.1.1.2 [AS 200] 292 msec *  196 msec

r1#show  ip route

Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets

C       1.1.1.0 is directly connected, FastEthernet0/0

     5.0.0.0/24 is subnetted, 1 subnets

B       5.1.1.0 [20/0] via 1.1.1.2, 00:47:16

     10.0.0.0/24 is subnetted, 1 subnets

C       10.1.1.0 is directly connected, Loopback0

     60.0.0.0/24 is subnetted, 1 subnets

B       60.1.1.0 [20/0] via 1.1.1.2, 00:47:16

r2#show     ip   route

Gateway of last resort is not set

     50.0.0.0/32 is subnetted, 1 subnets

B       50.1.1.1 [200/2] via 30.1.1.1, 01:05:17

     2.0.0.0/24 is subnetted, 1 subnets

C       2.1.1.0 is directly connected, FastEthernet1/0

     4.0.0.0/24 is subnetted, 1 subnets

B       4.1.1.0 [200/0] via 30.1.1.1, 01:05:17

     20.0.0.0/32 is subnetted, 1 subnets

C       20.1.1.1 is directly connected, Loopback0

     40.0.0.0/32 is subnetted, 1 subnets

B       40.1.1.1 [200/0] via 30.1.1.1, 01:05:17

     30.0.0.0/32 is subnetted, 1 subnets

O       30.1.1.1 [110/2] via 2.1.1.2, 01:10:32, FastEthernet1/0

r2#show   ip  route   vrf  ***

Routing Table: ***

Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets

C       1.1.1.0 is directly connected, FastEthernet0/0

     5.0.0.0/24 is subnetted, 1 subnets

B       5.1.1.0 [20/0] via 50.1.1.1, 00:48:24

     10.0.0.0/24 is subnetted, 1 subnets

B       10.1.1.0 [20/0] via 1.1.1.1, 01:44:40

     60.0.0.0/24 is subnetted, 1 subnets

B       60.1.1.0 [20/0] via 50.1.1.1, 00:48:24

r2#show    mpls  forwarding-table 

Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop    

tag    tag or VC   or Tunnel Id      switched   interface              

16     Pop tag     30.1.1.1/32       0          Fa1/0      2.1.1.2      

17     Aggregate   1.1.1.0/24[V]     2212                               

18     Untagged    10.1.1.0/24[V]    570        Fa0/0      1.1.1.1    

r3#show    ip     route

Gateway of last resort is not set

     50.0.0.0/32 is subnetted, 1 subnets

B       50.1.1.1 [20/2] via 3.1.1.2, 01:06:14

     2.0.0.0/24 is subnetted, 1 subnets

C       2.1.1.0 is directly connected, FastEthernet1/0

     3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

C       3.1.1.2/32 is directly connected, FastEthernet0/0

C       3.1.1.0/24 is directly connected, FastEthernet0/0

     4.0.0.0/24 is subnetted, 1 subnets

B       4.1.1.0 [20/0] via 3.1.1.2, 01:06:14

     20.0.0.0/32 is subnetted, 1 subnets

O       20.1.1.1 [110/2] via 2.1.1.1, 01:11:24, FastEthernet1/0

     40.0.0.0/32 is subnetted, 1 subnets

B       40.1.1.1 [20/0] via 3.1.1.2, 01:06:14

     30.0.0.0/32 is subnetted, 1 subnets

C       30.1.1.1 is directly connected, Loopback0

r3#show     mpls      forwarding-table 

Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop    

tag    tag or VC   or Tunnel Id      switched   interface              

16     Pop tag     20.1.1.1/32       9163       Fa1/0      2.1.1.1      

17     Pop tag     3.1.1.2/32        0          Fa0/0      3.1.1.2      

22     Pop tag     4.1.1.0/24        1140       Fa0/0      3.1.1.2      

23     Pop tag     40.1.1.1/32       0          Fa0/0      3.1.1.2      

24     16          50.1.1.1/32       9106       Fa0/0      3.1.1.2  

r4#show     ip     route 

Gateway of last resort is not set

     50.0.0.0/32 is subnetted, 1 subnets

O       50.1.1.1 [110/2] via 4.1.1.2, 01:07:17, FastEthernet1/0

     2.0.0.0/24 is subnetted, 1 subnets

B       2.1.1.0 [20/0] via 3.1.1.1, 01:07:06

     3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

C       3.1.1.1/32 is directly connected, FastEthernet0/0

C       3.1.1.0/24 is directly connected, FastEthernet0/0

     4.0.0.0/24 is subnetted, 1 subnets

C       4.1.1.0 is directly connected, FastEthernet1/0

     20.0.0.0/32 is subnetted, 1 subnets

B       20.1.1.1 [20/2] via 3.1.1.1, 01:07:06

     40.0.0.0/32 is subnetted, 1 subnets

C       40.1.1.1 is directly connected, Loopback0

     30.0.0.0/32 is subnetted, 1 subnets

B       30.1.1.1 [20/0] via 3.1.1.1, 01:07:07

r4#show       mpls      forwarding-table 

Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop    

tag    tag or VC   or Tunnel Id      switched   interface              

16     Pop tag     50.1.1.1/32       9071       Fa1/0      4.1.1.2      

17     Pop tag     3.1.1.1/32        0          Fa0/0      3.1.1.1      

18     Pop tag     2.1.1.0/24        570        Fa0/0      3.1.1.1      

19     16          20.1.1.1/32       9762       Fa0/0      3.1.1.1      

20     Pop tag     30.1.1.1/32       0          Fa0/0      3.1.1.1 

r5#show      ip    route

Gateway of last resort is not set

     50.0.0.0/32 is subnetted, 1 subnets

C       50.1.1.1 is directly connected, Loopback0

     2.0.0.0/24 is subnetted, 1 subnets

B       2.1.1.0 [200/0] via 40.1.1.1, 00:59:02

     4.0.0.0/24 is subnetted, 1 subnets

C       4.1.1.0 is directly connected, FastEthernet1/0

     20.0.0.0/32 is subnetted, 1 subnets

B       20.1.1.1 [200/2] via 40.1.1.1, 00:59:02

     40.0.0.0/32 is subnetted, 1 subnets

O       40.1.1.1 [110/2] via 4.1.1.1, 01:07:56, FastEthernet1/0

     30.0.0.0/32 is subnetted, 1 subnets

B       30.1.1.1 [200/0] via 40.1.1.1, 00:59:02

r5#show   ip   route  vrf  ***

Routing Table: ***

Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets

B       1.1.1.0 [20/0] via 20.1.1.1, 00:50:47

     5.0.0.0/24 is subnetted, 1 subnets

C       5.1.1.0 is directly connected, FastEthernet0/0

     10.0.0.0/24 is subnetted, 1 subnets

B       10.1.1.0 [20/0] via 20.1.1.1, 00:50:47

     60.0.0.0/24 is subnetted, 1 subnets

B       60.1.1.0 [20/0] via 5.1.1.2, 01:43:55

r5#show    mpls    forwarding-table 

Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop    

tag    tag or VC   or Tunnel Id      switched   interface              

16     Pop tag     40.1.1.1/32       0          Fa1/0      4.1.1.1      

17     Aggregate   5.1.1.0/24[V]     520                                

18     Untagged    60.1.1.0/24[V]    1812       Fa0/0      5.1.1.2  

r6#   show     ip   route

Gateway of last resort is not set

     1.0.0.0/24 is subnetted, 1 subnets

B       1.1.1.0 [20/0] via 5.1.1.1, 00:51:05

     5.0.0.0/24 is subnetted, 1 subnets

C       5.1.1.0 is directly connected, FastEthernet0/0

     10.0.0.0/24 is subnetted, 1 subnets

B       10.1.1.0 [20/0] via 5.1.1.1, 00:51:05

     60.0.0.0/24 is subnetted, 1 subnets

C       60.1.1.0 is directly connected, Loopback0

 

r6#traceroute    

Protocol [ip]: 

Target IP address: 10.1.1.1

Source address: 

Numeric display [n]: 

Timeout in seconds [3]: 

Probe count [3]: 

Minimum Time to Live [1]: 

Maximum Time to Live [30]: 

Port Number [33434]: 

Loose, Strict, Record, Timestamp, Verbose[none]: 

Type escape sequence to abort.

Tracing the route to 10.1.1.1

  1 5.1.1.1 52 msec 84 msec 16 msec

  2 4.1.1.1 [MPLS: Labels 19/18 Exp 0] 180 msec 236 msec 168 msec

  3 3.1.1.1 [MPLS: Labels 16/18 Exp 0] 196 msec 272 msec 144 msec

  4 1.1.1.2 [AS 100] [MPLS: Label 18 Exp 0] 176 msec 264 msec 148 msec

  5 1.1.1.1 [AS 100] 296 msec *  216 msec

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章