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#

转载于:https://blog.51cto.com/miller0intarnet/2140636

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值