日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

MPLS ×××配置

發(fā)布時間:2025/3/8 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 MPLS ×××配置 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
MPLS ×××配置
以下面拓撲為例配置MPLS ×××

拓撲說明:R1,R2、R3路由器上分別配置Loopback1 接口,IP地址分別為1.1.1.1,2.2.2.2 3.3.3.3;并配置OSPF,讓MPLS區(qū)域內的地址可以進行標簽交換

1、在MPLS區(qū)域配置標簽交換
R1:
interface Serial0/0
?ip address 12.1.1.1 255.255.255.0
?mpls label protocol ldp
?mpls ip

R2:
mpls label protocol ldp
interface Serial0/0
?ip address 12.1.1.2 255.255.255.0
?mpls ip
?serial restart-delay 0
!
interface Serial0/1
?ip address 23.1.1.2 255.255.255.0
?mpls ip
?serial restart-delay 0

R3:
interface Serial0/1
?ip address 23.1.1.3 255.255.255.0
?mpls label protocol ldp
?mpls ip
?serial restart-delay 0
驗證R1、R3雙方的Loopback1接口已經(jīng)進行標簽交換
R1#traceroute 3.3.3.3

Type escape sequence to abort.
Tracing the route to 3.3.3.3

? 1 12.1.1.2 [MPLS: Label 17 Exp 0] 56 msec 40 msec 40 msec
? 2 23.1.1.3 40 msec *? 40 msec

2、在R1、R3間配置普通的BGP,保證BGP鄰居的建立
R1#sh run | section bgp
router bgp 100
?no synchronization
?bgp log-neighbor-changes
?neighbor 3.3.3.3 remote-as 100
?neighbor 3.3.3.3 update-source Loopback1
?no auto-summary
R1#

R3#sh run | section bgp
router bgp 100
?no synchronization
?bgp log-neighbor-changes
?neighbor 1.1.1.1 remote-as 100
?neighbor 1.1.1.1 update-source Loopback1
?no auto-summary
R3#
驗證BGP鄰居已經(jīng)正常建立
R1#sh ip bgp summary
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor??????? V??? AS MsgRcvd MsgSent?? TblVer? InQ OutQ Up/Down? State/PfxRcd
3.3.3.3???????? 4?? 100????? 20????? 20??????? 1??? 0??? 0 00:17:42??????? 0
R1#

3、在PE上創(chuàng)建VRF,需要通信的兩個用戶網(wǎng)絡的VRF與RD值要保持一致
R1:
ip vrf ***1
?rd 100:1
!
R3:
ip vrf ***1
?rd 100:1
!

4、在PE上將連接CE的接口劃入到相應的VRF中,這樣表示從該接口進入的流量均通過VRF進行轉發(fā)
R1:
interface Serial0/1
?ip vrf forwarding ***1
?ip address 14.1.1.1 255.255.255.0
?serial restart-delay 0

R3:
!
interface Serial0/0
?ip vrf forwarding ***1
?ip address 23.1.1.3 255.255.255.0
?mpls label protocol ldp
?mpls ip
?serial restart-delay 0
!
在這里需要注意的是,當把一個接口加入到VRF中時,接口IP地址會丟失,需要重新配置IP地址。
在PE上查看VRF路由表
R1#sh ip route vrf ***1

Routing Table: ***1
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

???? 14.0.0.0/24 is subnetted, 1 subnets
C?????? 14.1.1.0 is directly connected, Serial0/1
R1#
在這里接口14.1.1.4已經(jīng)進入VRF路由表,需要說明的是該接口路由不會再出現(xiàn)在全局路由表中。

5、在R1、R3上創(chuàng)建MP-BGP幫助傳遞用戶網(wǎng)絡信息
R1:
router bgp 100
?no synchronization
?bgp log-neighbor-changes
?neighbor 3.3.3.3 remote-as 100
?neighbor 3.3.3.3 update-source Loopback1
?no auto-summary
?!
?address-family ***v4
? neighbor 3.3.3.3 activate
? neighbor 3.3.3.3 send-community both
?exit-address-family

R3:
router bgp 100
?no synchronization
?bgp log-neighbor-changes
?neighbor 1.1.1.1 remote-as 100
?neighbor 1.1.1.1 update-source Loopback1
?no auto-summary
?!
?address-family ***v4
? neighbor 1.1.1.1 activate
? neighbor 1.1.1.1 send-community both
?exit-address-family
驗證MP-BGP鄰居已經(jīng)建立
R1#sh ip bgp all summary
For address family: IPv4 Unicast
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor??????? V??? AS MsgRcvd MsgSent?? TblVer? InQ OutQ Up/Down? State/PfxRcd
3.3.3.3???????? 4?? 100????? 45????? 46??????? 1??? 0??? 0 00:08:45??????? 0

For address family: ×××v4 Unicast
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor??????? V??? AS MsgRcvd MsgSent?? TblVer? InQ OutQ Up/Down? State/PfxRcd
3.3.3.3???????? 4?? 100????? 45????? 46??????? 1??? 0??? 0 00:08:45??????? 0
R1#

6、為MP-BGP創(chuàng)建VRF表
R1(config)#router bgp 100
R1(config-router)#address-family ipv4 vrf ***1

R3(config)#router bgp 100
R3(config-router)#address-family ipv4 vrf ***1

7、配置PE-CE路由協(xié)議
在LAN1用戶網(wǎng)絡邊緣配置RIP
R1#sh running-config | section rip
router rip
?version 2
?no auto-summary
?!
?address-family ipv4 vrf ***1
? redistribute bgp 100 metric 1
? network 14.0.0.0
? no auto-summary
?exit-address-family

R4#sh running-config | section rip
router rip
?version 2
?network 10.0.0.0
?network 14.0.0.0
?no auto-summary
?
在LAN2用戶網(wǎng)絡邊緣配置OSPF
R3#sh running-config | section ospf
router ospf 100 vrf ***1
?router-id 36.1.1.3
?log-adjacency-changes
?redistribute bgp 100 subnets
?network 36.1.1.3 0.0.0.0 area 0

R6#sh running-config | section ospf
router ospf 100
?router-id 6.6.6.6
?log-adjacency-changes
?network 36.1.1.6 0.0.0.0 area 0
?network 192.168.1.6 0.0.0.0 area 0
R6#
驗證PE R1路由器已經(jīng)收到LAN1內部路由信息
R1#sh ip route vrf ***1

Routing Table: ***1
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

???? 10.0.0.0/24 is subnetted, 1 subnets
R?????? 10.1.1.0 [120/1] via 14.1.1.4, 00:00:00, Serial0/1
???? 14.0.0.0/24 is subnetted, 1 subnets
C?????? 14.1.1.0 is directly connected, Serial0/1
同理驗證R3也同樣擁有LAN2內部路由信息

8、將路由重分布進MP-BGP
R1:
router bgp 100
? address-family ipv4 vrf ***1
? redistribute rip
? no synchronization
?exit-address-family

R3:
!
router bgp 100
? address-family ipv4 vrf ***1
? redistribute ospf 100 vrf ***1
? no synchronization
?exit-address-family
驗證MP-BGP路由,到此PE上應該有雙方用戶網(wǎng)絡的路由信息
R1#sh ip bgp ***v4 all
BGP table version is 9, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
????????????? r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

?? Network????????? Next Hop??????????? Metric LocPrf Weight Path
Route Distinguisher: 100:1 (default for vrf ***1)
*> 10.1.1.0/24????? 14.1.1.4???????????????? 1???????? 32768 ?
*> 14.1.1.0/24????? 0.0.0.0????????????????? 0???????? 32768 ?
*>i36.1.1.0/24????? 3.3.3.3????????????????? 0??? 100????? 0 ?
*>i192.168.1.0????? 3.3.3.3??????????????? 128??? 100????? 0 ?
R1#

R3#sh ip bgp ***v4 all
BGP table version is 9, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
????????????? r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

?? Network????????? Next Hop??????????? Metric LocPrf Weight Path
Route Distinguisher: 100:1 (default for vrf ***1)
*>i10.1.1.0/24????? 1.1.1.1????????????????? 1??? 100????? 0 ?
*>i14.1.1.0/24????? 1.1.1.1????????????????? 0??? 100????? 0 ?
*> 36.1.1.0/24????? 0.0.0.0????????????????? 0???????? 32768 ?
*> 192.168.1.0????? 36.1.1.6?????????????? 128???????? 32768 ?
R3#

10、查看VRF路由

R1#sh ip route vrf ***1

Routing Table: ***1
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

???? 36.0.0.0/24 is subnetted, 1 subnets
B?????? 36.1.1.0 [200/0] via 3.3.3.3, 00:21:27
???? 10.0.0.0/24 is subnetted, 1 subnets
R?????? 10.1.1.0 [120/1] via 14.1.1.4, 00:00:25, Serial0/1
B??? 192.168.1.0/24 [200/128] via 3.3.3.3, 00:21:27
???? 14.0.0.0/24 is subnetted, 1 subnets
C?????? 14.1.1.0 is directly connected, Serial0/1
R1#

R3#sh ip route vr
R3#sh ip route vrf ***1

Routing Table: ***1
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

???? 36.0.0.0/24 is subnetted, 1 subnets
C?????? 36.1.1.0 is directly connected, Serial0/0
???? 10.0.0.0/24 is subnetted, 1 subnets
B?????? 10.1.1.0 [200/1] via 1.1.1.1, 00:28:37
O??? 192.168.1.0/24 [110/128] via 36.1.1.6, 00:22:30, Serial0/0
???? 14.0.0.0/24 is subnetted, 1 subnets
B?????? 14.1.1.0 [200/0] via 1.1.1.1, 00:28:37
R3#

11、查看CE路由
R4#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

???? 36.0.0.0/24 is subnetted, 1 subnets
R?????? 36.1.1.0 [120/1] via 14.1.1.1, 00:00:25, Serial0/1
???? 10.0.0.0/24 is subnetted, 1 subnets
C?????? 10.1.1.0 is directly connected, Serial0/0
R??? 192.168.1.0/24 [120/1] via 14.1.1.1, 00:00:25, Serial0/1
???? 14.0.0.0/24 is subnetted, 1 subnets
C?????? 14.1.1.0 is directly connected, Serial0/1
R4#

R6#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

???? 36.0.0.0/24 is subnetted, 1 subnets
C?????? 36.1.1.0 is directly connected, Serial0/0
???? 10.0.0.0/24 is subnetted, 1 subnets
O E2??? 10.1.1.0 [110/1] via 36.1.1.3, 00:23:58, Serial0/0
C??? 192.168.1.0/24 is directly connected, Serial0/1
???? 14.0.0.0/24 is subnetted, 1 subnets
O E2??? 14.1.1.0 [110/1] via 36.1.1.3, 00:23:58, Serial0/0
R6#

12、測試用戶通信
R5#traceroute 192.168.1.6

Type escape sequence to abort.
Tracing the route to 192.168.1.6

? 1 10.1.1.4 32 msec 36 msec 24 msec
? 2 14.1.1.1 12 msec 32 msec 40 msec
? 3 12.1.1.2 [MPLS: Labels 17/22 Exp 0] 68 msec 68 msec 104 msec
? 4 36.1.1.3 [MPLS: Label 22 Exp 0] 56 msec 96 msec 52 msec
? 5 36.1.1.6 100 msec *? 92 msec




轉載于:https://blog.51cto.com/martin1201/978552

總結

以上是生活随笔為你收集整理的MPLS ×××配置的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內容還不錯,歡迎將生活随笔推薦給好友。