设为首页 收藏本站
查看: 949|回复: 0

MPLS经典问题:利用MPLS解决和避免bgp路由黑洞问题

[复制链接]

尚未签到

发表于 2015-5-25 12:11:42 | 显示全部楼层 |阅读模式
  R1---(R2---R3---R4)--R5
|__EBGP__|_____IBGP______|__EBGP_|
12.0/24          23.0/24      34.0/24   45.0/24
  R2-R4是MPLS域
在R2和R4上重分布直连面向EBGP邻居的接口
使用R1和R5上的loopback1做为internet路由
  r1#sh ip b
BGP table version is 7, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure
Origin codes: i - IGP, e - EGP, ? - incomplete
  Network          Next Hop            Metric LocPrf Weight Path
*> 11.11.11.11/32   0.0.0.0                  0         32768 i
*> 55.55.55.55/32   192.168.12.2                           0 1 3 i
*> 192.168.12.0     192.168.12.2             0             0 1 ?
*> 192.168.45.0     192.168.12.2                           0 1 ?

  r5#sh ip b
BGP table version is 7, local router ID is 5.5.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure
Origin codes: i - IGP, e - EGP, ? - incomplete
  Network          Next Hop            Metric LocPrf Weight Path
*> 11.11.11.11/32   192.168.45.4                           0 1 2 i
*> 55.55.55.55/32   0.0.0.0                  0         32768 i
*> 192.168.12.0     192.168.45.4                           0 1 ?
*> 192.168.45.0     192.168.45.4             0             0 1 ?
-------------------------------
r2#  sh ip b
BGP table version is 5, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure
Origin codes: i - IGP, e - EGP, ? - incomplete
  Network          Next Hop            Metric LocPrf Weight Path
*> 11.11.11.11/32   192.168.12.1             0             0 2 i
*>i55.55.55.55/32   192.168.45.5             0    100      0 3 i
*> 192.168.12.0     0.0.0.0                  0         32768 ?
*>i192.168.45.0    4.4.4.4                  0    100      0 ?

r2#sh ip route
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/129] via 192.168.23.3, 01:26:32, Serial2/0

r2查找路由表,发现i55.55.55.55/32是一条bgp路由,而mpls不会为从bgp收到的路由分配标签,它再次查找,发现 i55.55.55.55/32的下一跳地址是192.168.45.5,同理,再次查找路由表,终于发现4.4.4.4是一条IGP路由,正好R3给4.4.4.4分配了一个301的标签给R2,这时候,最无耻的事情发生了,R2将这个标签copy到CEF表里面关于到55.55.55.55和192.168.45.0/24,的压入标签里面,也就是所有从192.168.45.5收到的bgp路由都有这种行为,如下所示:
  r2#show ip cef detail
  4.4.4.4/32, version 10, epoch 0, cached adjacency to Serial2/0
0 packets, 0 bytes
  tag informationset, shared
    local tag: 201
    fast tag rewrite with Se2/0, point2point, tags imposed: {301}
  via 192.168.23.3, Serial2/0, 1 dependency
    next hop 192.168.23.3, Serial2/0
    valid cached adjacency
    tag rewrite with Se2/0, point2point, tags imposed: {301}
  55.55.55.55/32, version 19, epoch 0, cached adjacency to Serial2/0
0 packets, 0 bytes
  tag information from 4.4.4.4/32, shared
    local tag: 201
    fast tag rewrite with Se2/0, point2point, tags imposed: {301}
  via 192.168.45.5, 0 dependencies, recursive
    next hop 192.168.23.3, Serial2/0 via 192.168.45.0/24
    valid cached adjacency
    tag rewrite with Se2/0, point2point, tags imposed: {301}

192.168.45.0/24, version 18, epoch 0, cached adjacency to Serial2/0
0 packets, 0 bytes
  tag information from 4.4.4.4/32, shared
    local tag: 201
    fast tag rewrite with Se2/0, point2point, tags imposed: {301}
  via 4.4.4.4, 1 dependency, recursive
    next hop 192.168.23.3, Serial2/0 via 4.4.4.4/32
    valid cached adjacency
    tag rewrite with Se2/0, point2point, tags imposed: {301}

------------------------------------
  路由器不会对从bgp收到的路由分配标签,所以在这里看不到55.55.55.55/32的标签绑定
r2#sho tag tdp bind      
  tib entry: 2.2.2.2/32, rev 4
        local binding:  tag: imp-null
        remote binding: tsr: 3.3.3.3:0, tag: 300
  tib entry: 3.3.3.3/32, rev 6
        local binding:  tag: 200
        remote binding: tsr: 3.3.3.3:0, tag: imp-null
  tib entry: 4.4.4.4/32, rev 8
        local binding:  tag: 201
        remote binding: tsr: 3.3.3.3:0, tag: 301
  tib entry: 192.168.12.0/24, rev 2
        local binding:  tag: imp-null
  tib entry: 192.168.23.0/24, rev 10
        local binding:  tag: imp-null
        remote binding: tsr: 3.3.3.3:0, tag: imp-null
  tib entry: 192.168.34.0/24, rev 12
        local binding:  tag: 202
        remote binding: tsr: 3.3.3.3:0, tag: imp-null
  当R3收到带有301标签的mpls packet的时候,根据自己的标签转发表,进行次末跳弹出,下一跳是4.4.4.4/32,而4.4.4.4/32已经具有internet路由,所以它可以正常转发
  r3#show tag-switching forwarding-table
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop   
tag    tag or VC   or Tunnel Id      switched   interface              
300    Pop tag     2.2.2.2/32        4061       Se2/0      point2point  
301    Pop tag     4.4.4.4/32        4457       Se1/0      point2point  
  而这时候,在R3上不存在55.55.55.55/32路由
r3#sh ip rou
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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
  2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/65] via 192.168.23.2, 00:28:23, Serial2/0
     3.0.0.0/32 is subnetted, 1 subnets
C       3.3.3.3 is directly connected, Loopback0
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/65] via 192.168.34.4, 00:28:23, Serial1/0
C    192.168.23.0/24 is directly connected, Serial2/0
C    192.168.34.0/24 is directly connected, Serial1/0
  这就是利用mpls来避免bgp的路由黑洞问题,应该是说清楚了吧?^_^

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-70546-1-1.html 上篇帖子: CCIE路由实验(1) 下篇帖子: BGP:常见问题
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表