Spring中的aware接口详情
687
2022-09-23
教你解决路由黑洞5招(黑洞路由原理)
如何解决路由黑洞?
1、全互联(全互联的意思就是在一个AS内的所有的BGP路由器全部都建立我们Establish的关系)2、RR(反射器)3、联盟(一般用的不多)4、将BGP路由引入到IGP,从而保证IGP与BGP的同步。但是,因为Internet上的BGP路由数量十分庞大,一旦引入到IGP,会给IGP路由器带来巨大的处理和存储负担,如果路由器负担过重,则可能瘫痪 不建议5、MPLS技术解决路由黑洞问题
解决方法1.全互联
# bgp 200 router-id 2.2.2.2 peer 3.3.3.3 as-number 200 peer 3.3.3.3 connect-interface LoopBack0 peer 4.4.4.4 as-number 200 peer 4.4.4.4 connect-interface LoopBack0 peer 192.168.12.1 as-number 100 # ipv4-family unicast undo synchronization peer 3.3.3.3 enable peer 3.3.3.3 next-hop-local peer 4.4.4.4 enable peer 4.4.4.4 next-hop-local #
R3的BGP配置
# bgp 200 peer 2.2.2.2 as-number 200 peer 2.2.2.2 connect-interface LoopBack0 peer 4.4.4.4 as-number 200 peer 4.4.4.4 connect-interface LoopBack0 # ipv4-family unicast undo synchronization peer 1.1.1.1 enable peer 4.4.4.4 enable #
R4的BGP配置
# bgp 200 router-id 4.4.4.4 peer 2.2.2.2 as-number 200 peer 2.2.2.2 connect-interface LoopBack0 peer 3.3.3.3 as-number 200 peer 3.3.3.3 connect-interface LoopBack0 # ipv4-family unicast undo synchronization peer 2.2.2.2 enable peer 2.2.2.2 next-hop-local peer 3.3.3.3 enable peer 3.3.3.3 next-hop-local #
在R3上检查IBGP的关系
[R3]display bgp peer BGP local router ID : 192.168.34.3 Local AS number : 200 Total number of peers : 2 Peers in established state : 2 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 2.2.2.2 4 200 3 2 0 00:00:02 Established 1 4.4.4.4 4 200 5 5 0 00:02:30 Established 1 [R3]
在R3上面看下是否能够学习到关系1.1.1.1和5.5.5.5的路由
[R3]display bgp routing-table BGP Local router ID is 192.168.34.3 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete Total Number of Routes: 2 Network NextHop MED LocPrf PrefVal Path/Ogn *>i 1.1.1.1/32 2.2.2.2 0 100 0 100i *>i 5.5.5.5/32 4.4.4.4 0 100 0 300i [R3]
在R5上面访问R1
缺点:BGP 200里面的设备越多 需要建立IBGP的数量也就越多 可以考虑用反射器解决
解决方法2.RR
# bgp 200 router-id 2.2.2.2 peer 3.3.3.3 as-number 200 //R2和反射器建立IBGP关系 peer 3.3.3.3 connect-interface LoopBack0 # ipv4-family unicast undo synchronization peer 3.3.3.3 enable peer 3.3.3.3 next-hop-local #
R4的配置
# bgp 200 router-id 4.4.4.4 peer 3.3.3.3 as-number 200 //R2和反射器建立IBGP关系 peer 3.3.3.3 connect-interface LoopBack0 peer 192.168.45.5 as-number 300 # ipv4-family unicast undo synchronization peer 3.3.3.3 enable peer 3.3.3.3 next-hop-local #
R3的配置
# bgp 200 peer 2.2.2.2 as-number 200 peer 2.2.2.2 connect-interface LoopBack0 peer 4.4.4.4 as-number 200 peer 4.4.4.4 connect-interface LoopBack0 # ipv4-family unicast undo synchronization peer 2.2.2.2 enable peer 2.2.2.2 reflect-client //R2反射器和客户端建立IBGP关系 peer 4.4.4.4 enable peer 4.4.4.4 reflect-client //R2反射器和客户端建立IBGP关系 #
在R5上面访问R1
解决方法3.联盟
# bgp 1000 //R2上面直接配置子AS 1000 router-id 2.2.2.2 confederation id 200 //R2对外还是宣称在AS 200里面 confederation peer-as 2000 //指定和对端子AS 2000建立EBGP关系 peer 192.168.12.1 as-number 100 peer 192.168.23.3 as-number 2000 # ipv4-family unicast undo synchronization peer 192.168.12.1 enable peer 192.168.23.3 enable peer 192.168.23.3 next-hop-local //在AS 200内部虽然R2和R3是EBGP关系 但是毕竟R2 和R3在一个AS 200当中 R2从R1学习到的路由 发给R3的时候下一跳还是不变化 所以需要敲如下命令实现R2发给R3的时候下一跳为R2本身 #
在R3这边的配置
# bgp 2000 confederation id 200 confederation peer-as 1000 3000 peer 192.168.23.2 as-number 1000 peer 192.168.34.4 as-number 3000 # ipv4-family unicast undo synchronization peer 192.168.23.2 enable peer 192.168.34.4 enable #
在R4这边的配置
# bgp 3000 confederation id 200 confederation peer-as 2000 peer 192.168.34.3 as-number 2000 peer 192.168.45.5 as-number 300 # ipv4-family unicast undo synchronization peer 192.168.34.3 enable peer 192.168.34.3 next-hop-local peer 192.168.45.5 enable #
检查R2 R3 R4的BGP关系
[R3]display bgp peer BGP local router ID : 192.168.34.3 Local AS number : 2000 Total number of peers : 2 Peers in established state : 2 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 192.168.23.2 4 1000 18 21 0 00:09:00 Established 1 192.168.34.4 4 3000 13 21 0 00:08:17 Established 1 [R3]
[R4]display bgp peer BGP local router ID : 192.168.34.4 Local AS number : 3000 Total number of peers : 2 Peers in established state : 2 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 192.168.34.3 4 2000 20 13 0 00:08:21 Established 1 192.168.45.5 4 300 10 12 0 00:07:23 Established 1 [R4]
检查R2 R3 R4的路由
[R4]display bgp routing-table BGP Local router ID is 192.168.34.4 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete Total Number of Routes: 2 Network NextHop MED LocPrf PrefVal Path/Ogn *>i 1.1.1.1/32 192.168.23.2 0 100 0 (2000 1000) 100i *> 5.5.5.5/32 192.168.45.5 0 0 300i [R4]
[R3]display bgp routing-table BGP Local router ID is 192.168.34.3 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete Total Number of Routes: 2 Network NextHop MED LocPrf PrefVal Path/Ogn *>i 1.1.1.1/32 192.168.23.2 0 100 0 (1000) 100i *>i 5.5.5.5/32 192.168.34.4 0 100 0 (3000) 300i [R3]
在R5上面访问R1
缺点:联盟的配置改动量特别大 不建议还割接的时候用这个方式
解决方法4. 将BGP路由引入到IGP
# ospf 1 router-id 2.2.2.2 import-route bgp #
R4的配置
# ospf 1 router-id 4.4.4.4 import-route bgp #
查看R3的路由表
在R5上面访问R1
思考如下:能不能只在R2或者R4上面进行引入?会有什么问题?如何解决?
解决方法5.MPLS技术
# mpls lsr-id 2.2.2.2 # mpls # mpls ldp # interface GigabitEthernet0/0/1 mpls mpls ldp #
在R3上的配置
# mpls lsr-id 3.3.3.3 # mpls # mpls ldp # interface GigabitEthernet0/0/1 mpls mpls ldp # interface GigabitEthernet0/0/0 mpls mpls ldp #
在R4上的配置
# mpls lsr-id 4.4.4.4 # mpls # mpls ldp # interface GigabitEthernet0/0/0 mpls mpls ldp #
检查LDP的关系
在R5上面访问R1
注意:MPLS 虚拟私有网络就是靠这种方式实现的
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~