MPLS ×××業務分流案例

MPLS ×××業務分流案例redis

1.各路由器基本信息配置網絡

2.OSPF規範配置,修改網絡類型爲點對點,配置被動接口ide

3.MPLS骨幹網運行OSPF,標籤分發協議爲LDPoop

4.RT4和RT5運行MP_IPGP,利用MPLS ×××實現生產與辦公業務分流ui

5.RT4 VRF SC與RT6運行RIP、RT4 VRF BG 與RT7配置靜態路由、RT5 VRF SC與RT8運行OSPF,RT5 VRF BG與RT9運行EBGProuter

IP地址規劃以下:blog

一.基本配置(略)接口

二.骨幹網IGP調測ip

RT1:路由

router ospf 1

router-id 1.1.1.1

passive-interface Ethernet3/0

network 1.1.1.1 0.0.0.0 area 0

network 10.0.12.0 0.0.0.3 area 0

network 10.0.13.0 0.0.0.3 area 0

RT2:

router ospf 1

router-id 2.2.2.2

passive-interface default

no passive-interface Serial0/0

no passive-interface Serial0/1

no passive-interface FastEthernet1/0

network 2.2.2.2 0.0.0.0 area 0

network 10.0.12.0 0.0.0.3 area 0

network 10.0.23.0 0.0.0.3 area 0

network 10.0.24.0 0.0.0.3 area 0

int f1/0

ip ospf network point-to-point

RT3:

router ospf 1

router-id 3.3.3.3

passive-interface default

no passive-interface Serial0/0

no passive-interface Serial0/1

no passive-interface FastEthernet1/0

network 3.3.3.3 0.0.0.0 area 0

network 10.0.13.0 0.0.0.3 area 0

network 10.0.23.0 0.0.0.3 area 0

network 10.0.35.0 0.0.0.3 area 0

int f1/0

ip ospf network point-to-point

RT4:

router ospf 1

router-id 4.4.4.4

passive-interface default

no passive-interface Serial0/0

network 4.4.4.4 0.0.0.0 area 0

network 10.0.24.0 0.0.0.3 area 0

RT5:

router ospf 1

router-id 5.5.5.5

passive-interface default

no passive-interface Serial0/0

network 5.5.5.5 0.0.0.0 area 0

network 10.0.35.0 0.0.0.3 area 0

三.骨幹網MPLS 調測

RT1:

ip cef                     // MPLS必須開啓CEF

mpls ip                    //開啓MPLS協議

mpls label protocol ldp    //選擇標籤分發協議爲LDP

int s0/1

mpls ip         //在接口上開啓MPLS

mpls mtu 1600   //設置最大MPLS MTU爲1600

int s0/2

mpls ip

mpls mtu 1600

RT2:

ip cef

mpls ip

mpls label protocol ldp

int s0/0

mpls ip

mpls mtu 1600

int s0/1

mpls ip

mpls mtu 1600

int f1/0

mpls ip

mpls mtu 1600

RT3:

ip cef

mpls ip

mpls label protocol ldp

int s0/0

mpls ip

mpls mtu 1600

int s0/1

mpls ip

mpls mtu 1600

int f1/0

mpls ip

mpls mtu 1600

RT4:

ip cef

mpls ip

mpls label protocol ldp

int s0/0

mpls ip

mpls mtu 1600

RT5:

ip cef

mpls ip

mpls label protocol ldp

int s0/0

mpls ip

mpls mtu 1600

四.骨幹網MP_BGP調測

RT4:

router bgp 65000

no synchronization                           //關閉同步

neighbor 5.5.5.5 remote-as 65000            //創建BGP鄰居

neighbor 5.5.5.5 update-source Loopback0   //指定更新源

neighbor 5.5.5.5 next-hop-self            //改變下一跳爲本身

no auto-summary                          //關閉自動彙總

address-family ***v4                    //開啓MP_BGP

neighbor 5.5.5.5 activate               //創建MP_BGP鄰居

neighbor 5.5.5.5 send-community extended //支持團體屬性

exit-address-family                      //退出MP_BGP的配置

RT5:

router bgp 65000

no synchronization

bgp log-neighbor-changes

neighbor 4.4.4.4 remote-as 65000

neighbor 4.4.4.4 update-source Loopback0

neighbor 4.4.4.4 next-hop-self

no auto-summary

address-family ***v4

neighbor 4.4.4.4 activate

neighbor 4.4.4.4 send-community extended

exit-address-family

五.VRF調測

RT4:

  ip vrf BG                             //創建VRF 命名爲BG

  rd 2:2                                //VRF的RD爲2:2

route-target export 2:20              //導出RT爲2:20

route-target import 2:10              //導入RT爲2:10

ip vrf SC

rd 1:1

route-target export 1:20

route-target import 1:10

RT5:

ip vrf BG

rd 2:2

route-target export 2:10

route-target import 2:20

ip vrf SC

rd 1:1

route-target export 1:10

route-target import 1:20

六.PE與CE路由協議調測

RT4:

router rip                          //配置CE與PE VRF之間路由協議

version 2

no auto-summary

address-family ipv4 vrf SC             //配置MP_BGP

network 172.16.0.0

no auto-summary

version 2

exit-address-family

RT6:

router rip           

version 2

network 6.0.0.0

network 172.16.0.0

no auto-summary

RT4:

ip route vrf BG 7.7.7.7 255.255.255.255 Serial0/2 172.17.47.2  //在VRF BG中添加靜態路由

ip route vrf BG 172.17.7.0 255.255.255.0 Serial0/2 172.17.47.2

RT7:

ip route 0.0.0.0 0.0.0.0 172.17.47.1  //配置缺省路由

RT5:

router ospf 101 vrf SC               //配置VRF SC OSPF

router-id 172.16.5.1

network 172.16.5.0 0.0.0.255 area 0

network 172.16.58.0 0.0.0.3 area 0

RT8:

router ospf 1

router-id 8.8.8.8

passive-interface Ethernet3/0

network 8.8.8.8 0.0.0.0 area 0

network 172.16.8.0 0.0.0.255 area 0

network 172.16.58.0 0.0.0.3 area 0

network 0.0.0.0 255.255.255.255 area 0

RT5:

router bgp 65000                               //配置EBGP

address-family ipv4 vrf BG                    //配置MP_BGP

neighbor 172.17.59.2 remote-as 65001         //創建EBGP鄰居

no auto-summary

no synchronization

exit-address-family

RT9:

router bgp 65001

no synchronization

network 9.9.9.9 mask 255.255.255.255

network 172.17.9.0 mask 255.255.255.0

network 172.17.59.0 mask 255.255.255.252

neighbor 172.17.59.1 remote-as 65000

no auto-summary

七.MPLS ×××調測

RT4:

router bgp 65000

address-family ipv4 vrf SC                   

redistribute connected metric 1000      //重分佈直連到MP_BGP

redistribute rip metric 1000            //重RIP直連到MP_BGP

no auto-summary

no synchronization

exit-address-family

address-family ipv4 vrf BG

redistribute connected metric 1000   //重分佈直連到MP_BGP

redistribute static metric 1000      //重分佈靜態到MP_BGP

no auto-summary

no synchronization

exit-address-family

router rip

redistribute bgp 65000 metric 5        //重分佈VRF SC到RIP

RT5:

router bgp 65000

address-family ipv4 vrf SC

redistribute connected metric 1000  //重分佈直連到MP_BGP

redistribute ospf 101 vrf SC metric 1000 match internal external 1 external 2    //重分佈OSPF 101 VRF SC中的匹配外部5類類型1和類型2的路由到MP_BGP中

no auto-summary

no synchronization

exit-address-family

address-family ipv4 vrf BG

redistribute connected metric 1000 //重分佈直連到MP_BGP

exit-address-family

//PE_CE路由協議爲EBGP時,VRF中的EBGP路由自動導出至MP_BGP表。

調測命令:

show ip bgp ***v4 all summary  //顯示MP_BGP的鄰居信息

show mpls forwarding-tabel    //顯示MPLS轉發表

show mpls ldp bindings        //顯示MPLS LDP的標籤綁定信息

show ip route vrf SC         //顯示VRF SC的路由信息

show ip bgp ***v4 all       //顯示BGP中×××V4的全部路由

show ip bgp ***v4 all labels //顯示BGP中×××V4的全部路由及標籤

若是配置沒有問題,而某條路由在MP-BGP表中存在,而沒有本身導入VRF,請使用:

clear ip route vrf ×××名字

分析RT8的172.16.8.0/24路由的傳播:

1.首先RT8上有一條直連路由

C       172.16.8.0/24 is directly connected, Ethernet3/0

2.RT5的VRF SC與RT8配置了OSPF(CE與PE VRF路由協議),經過OSPF將172.16.8.0/24路由傳播到RT5的VRF SC(這條路由只在VRF SC中能看到,在RT5的全局路由表中不存在)

RT5#show ip route vrf SC

O       172.16.8.0/24 [110/110] via 172.16.58.2, 00:08:58, Serial0/1

3.經過重分佈將OSPF的路由發佈到MP_BGP中,同時爲這路由加上RT、RD、私網標籤

RT5#show ip bgp ***v4 all labels

Route Distinguisher: 1:1 (SC)

172.16.8.0/24    172.16.58.2     26/nolabel

RD爲1:1 ×××名爲SC  下一跳爲172.16.58.2私網IN標籤爲26 OUT標籤爲無

同時在MPLS標籤轉發中造成轉發條目

RT5#show mpls forwarding-table

26     Untagged    172.16.8.0/24[V]  0          Se0/1     point2point

LOCAL標籤爲26(分發出去的私網標籤)OUT標籤爲Untagged 刪除標籤 下一條爲S0/1

4.MP_BGP發起路由,經過update來報文傳播路由,打上公網標籤,經過LSP傳遞到RT4(公網標籤用來在MPLS網絡中轉發,LSP上的轉發過程再也不敘述)

RT5#show ip bgp ***v4 all

Route Distinguisher: 1:1 (default for vrf SC)

*> 172.16.8.0/24    172.16.58.2           1000         32768 ?

MP_BGP始發此路由

以上是MP_BGP的update報文,就是將原有的BGP的NIRL屬性和不可達路由屬性替換成MP_REACH_NLRI和MP_UNREACH_NIRL屬性

Extended_Communities屬性中有RT爲1:10

MP_REACH_NLRI屬性中有私網標籤爲26 RD爲1:1 IPV4路由172.16.8.0/24

VRF的IPV4路由打上RD,就變成了×××V4路由

補充:

   RD路由區分符,主要用來標識不一樣的IP地址空間,所以每一個VRF都必須(也只能)配置1個RD;

   RT路由目標,就是Extended Comununity屬性,用來控制VRF之間的互訪關係,將VRF的IPV4路由打上RT導出到MP_BGP中,經PE-PE之間MP-IBGP鄰居傳播到遠端的PE上,遠端PE進行RT匹配,根據RT的匹配關係,將這些路由導入到不一樣的VRF中。利用RT的導入導出關係,控制VRF的訪問範圍,就造成了不一樣的×××,也就實現了業務分流。

5.RT4的MP_BGP收到此update報文後,比較RT是否跟本身的VRF入RT一致,如有一致,則導入到相應的VRF中,這裏的是與RT4的VRF SC一致,因此導入

,同時將私網標籤和RD保存

RT4#show ip bgp ***v4 all labels

Route Distinguisher: 1:1 (SC)

   172.16.8.0/24    5.5.5.5         nolabel/26

RD爲1:1 ×××名爲SC 下一跳爲5.5.5.5 私網IN標籤爲無 OUT標籤爲26

RT4#show ip bgp ***v4 all labels

Route Distinguisher: 1:1 (SC)

*>i172.16.8.0/24    5.5.5.5               1000    100      0 ?

RT4收到的BGP路由

6.經過重分佈將MP_BGP的路由發佈到RIP中,經過RT4的VRF SC與RT6之間的RIP路由協議將路由傳遞給RT6,最後RT6上造成一條RIP路由

R       172.16.8.0/24 [120/5] via 172.16.46.1, 00:00:21, Serial0/0

其它CE與PE VRF間的IGP路由協議路由的傳播與以上相似

RT6的與RT8的172.168.1的通訊過程分析(其中所提到的路由條目可看上面):

首先RT6收到數據包,以目標IP查找路由,找到匹配項出接口爲S0/0,數據轉發,RT4的VRF SC收到該數據包,查找路由表,找到匹配的BGP路由,私網OUT標籤爲26,下一跳爲5.5.5.5,不是直連的,以5.5.5.5爲目標IP查找MPLS轉發表,找到匹配項,OUT標籤爲21(關於5.5.5.5標籤的分發看前面的博文吧)

,出接口爲S0/0,爲直鏈接口轉發,經過LSP傳播到RT5(中間MPLS轉發見前面博文),RT5經過私網標籤26查找MPLS轉發表,找到匹配項,OUT標籤爲Untagged ,刪除標籤,從出接口S0/1轉發出去,RT8收到數據包,查找路由表,交給相應的接口。

附加:RT7能夠訪問RT8和RT9,RT6只能和RT8通信 應該怎麼配置VRF

RT4 VRF BG配置以下:

ip vrf BG                            

  rd 2:2                               

route-target export 2:20            

route-target import 2:10  

route-target import 1:10

RT5的VRF SC配置以下:

ip vrf SC

rd 1:1

route-target export 1:10

route-target import 1:20

route-target import 2:20

其它配置同上不變!便可實現以上需求!

末作修改前是不通的,修改後能夠互通!VRF的RT能夠靈活運用,來使業務分流!後面將會有一篇MPLS ×××互訪關係控制案例!這裏就很少講了!

本文出自 「凡人世界」 博客,謝絕轉載!

相關文章
相關標籤/搜索