MPLS ××× RT理解的LAB

MPLS ××× RT理解的LAB

IP,配置習慣爲AB.1.1.AB/24(如R1與R2互聯口爲12.1.1.1、2), LOOPBACK 0: X.X.X.X
R1,R2,R3,R6 (IBGP與R2,且R2爲IBGP’S RR, MP-IBGP’S RR)
IGP使用OSPF打通之間的路由,並啓用MPLS , CEF,
PE3#sh mpls ldp neighbor

*****R2****
router bgp 123
bgp log-neighbor-changes
neighbor 1.1.1.1 remote-as 123
neighbor 1.1.1.1 update-source Loopback0
neighbor 1.1.1.1 route-reflector-client
neighbor 3.3.3.3 remote-as 123
neighbor 3.3.3.3 update-source Loopback0
neighbor 3.3.3.3 route-reflector-client
neighbor 6.6.6.6 remote-as 123
neighbor 6.6.6.6 update-source Loopback0
neighbor 6.6.6.6 route-reflector-client
!
address-family *
v4
neighbor 1.1.1.1 activate
neighbor 1.1.1.1 send-community extended
neighbor 1.1.1.1 route-reflector-client
neighbor 3.3.3.3 activate
neighbor 3.3.3.3 send-community extended
neighbor 3.3.3.3 route-reflector-client
neighbor 6.6.6.6 activate
neighbor 6.6.6.6 send-community extended
neighbor 6.6.6.6 route-reflector-client
exit-address-family
P#

PE2# *****R3****
router bgp 123
bgp log-neighbor-changes
neighbor 2.2.2.2 remote-as 123
neighbor 2.2.2.2 update-source Loopback0
neighbor 2.2.2.2 next-hop-self
!
address-family *
v4
neighbor 2.2.2.2 activate
neighbor 2.2.2.2 send-community extended
neighbor 2.2.2.2 next-hop-self
exit-address-family
!
address-family ipv4 vrf C
neighbor 35.1.1.5 remote-as 5
neighbor 35.1.1.5 activate
exit-address-family
PE2#
ip prefix-list 57 seq 5 permit 5.5.5.5/32 ##定義發出的路由前綴,做導出RT修改,區別於3:3
ip vrf C
rd 3:3
export map 57
route-target export 3:3
route-target import 5:5
route-target import 7:5 **對端PE對7.7.7.7/32路由前綴,導出的RT值;
!
定義route-map*****
route-map 57 permit 10
match ip address prefix-list 57
set extcommunity rt 5:7
route-map 57 permit 20
set extcommunity rt 3:3 ##這行可有可無,僅做策略對5.5.5.5與7.7.7.7之間互通;

PE3# ***R6****
ip prefix-list 75 seq 5 permit 7.7.7.7/32
!

ip vrf A
rd 6:6
export map 75
route-target export 7:7
route-target import 5:5
route-target import 5:7

!
route-map 75 permit 10
match ip address prefix-list 75
set extcommunity rt 7:5
route-map 75 permit 20
!

#
#
驗證##
R2##RR

P#SH BG v4 UNicast AL 5.5.5.5
BGP routing table entry for 3:3:5.5.5.5/32, version 17
Paths: (1 available, best #1, no table)
Advertised to update-groups:
1
Refresh Epoch 22
5, (Received from a RR-client)
3.3.3.3 (metric 11) from 3.3.3.3 (3.3.3.3)
Origin IGP, metric 0, localpref 100, valid, internal, best
Extended Community: RT:5:7
mpls labels in/out nolabel/305
rx pathid: 0, tx pathid: 0x0
P#
P#SH BG
v4 UNicast AL 7.7.7.7
BGP routing table entry for 6:6:7.7.7.7/32, version 16
Paths: (1 available, best #1, no table)
Advertised to update-groups:
1
Refresh Epoch 11
7, (Received from a RR-client)
6.6.6.6 (metric 11) from 6.6.6.6 (6.6.6.6)
Origin IGP, metric 0, localpref 100, valid, internal, best
Extended Community: RT:7:5
mpls labels in/out nolabel/607
rx pathid: 0, tx pathid: 0x0
P#

PE2#sh bg all **R3****
For address family: IPv4 Unicast

For address family: ×××v4 Unicast

BGP table version is 23, 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, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 1:1
>i 4.4.4.4/32 1.1.1.1 0 100 0 4 i
>i 14.1.1.0/24 1.1.1.1 0 100 0 4 i
Route Distinguisher: 3:3 (default for vrf C)
>i 4.4.4.4/32 1.1.1.1 0 100 0 4 i
> 5.5.5.5/32 35.1.1.5 0 0 5 i
>i 7.7.7.7/32 6.6.6.6 0 100 0 7 i
>i 14.1.1.0/24 1.1.1.1 0 100 0 4 i
r> 35.1.1.0/24 35.1.1.5 0 0 5 i
Route Distinguisher: 6:6
>i 7.7.7.7/32 6.6.6.6 0 100 0 7 i

#
#

PE2#
這個互聯的是沒有導進來的,可以在R2查看下RT值;

P#SH BG *v4 UNicast AL 67.1.1.0
BGP routing table entry for 6:6:67.1.1.0/24, version 15
Paths: (1 available, best #1, no table)
Advertised to update-groups:
1
Refresh Epoch 11
7, (Received from a RR-client)
6.6.6.6 (metric 11) from 6.6.6.6 (6.6.6.6)
Origin IGP, metric 0, localpref 100, valid, internal, best
Extended Community: RT:7:7
這裏還是保持原有的RT值,因此沒被R3導入
mpls labels in/out nolabel/608
rx pathid: 0, tx pathid: 0x0

###
#
#

R5_CEB#sh bg all
For address family: IPv4 Unicast

BGP table version is 10, local router ID is 5.5.5.5
Status codes: s suppressed, d damped, h history, valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
> 4.4.4.4/32 35.1.1.3 0 123 4 i
> 5.5.5.5/32 0.0.0.0 0 32768 i
> 7.7.7.7/32 35.1.1.3 0 123 7 i
> 14.1.1.0/24 35.1.1.3 0 123 4 i
> 35.1.1.0/24 0.0.0.0 0 32768 i

#

#

R5_CEB#ping 7.7.7.7
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 7.7.7.7, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R5_CEB#

R5_CEB#ping 7.7.7.7 source l0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 7.7.7.7, timeout is 2 seconds:
Packet sent with a source address of 5.5.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
R5_CEB#

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