挑战20W年薪协议---BGP协议(BGP通告原则)

网友投稿 253 2022-09-23


挑战20W年薪协议---BGP协议(BGP通告原则)

BGP通告原则之一

display bgp routing-table BGP Local router ID is 2.2.2.2 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete Total Number of Routes: 6 Network NextHop MED LocPrf PrefVal Path/Ogn *>i 10.10.10.10/32 1.1.1.1 0 100 0 ? *> 22.22.22.22/32 0.0.0.0 0 0 i *> 44.44.44.44/32 24.1.1.4 0 0 200i * i 3.3.3.3 0 100 0 200i *>i 100.100.100.100/32 1.1.1.1 0 100 0 i *>i 101.101.101.101/32 1.1.1.1 0 100 0 ?

 注意点: *号 表示valid(有效) >号 表示best(最优) 思考一下:为什么RTD到达100网段得下一跳为10.1.12.1?BGP在整个AS内 不会改变下一跳 但是BGP在AS和AS之间的时候 下一跳会发生改变修改方法如下:

peer 4.4.4.4 next-hop-local

BGP通告原则之二

BGP通告原则之三

BGP通告原则之四

BGP与IGP同步(华为默认关闭,开启不了)

undo synchronization

什么是路由黑洞?

display ospf peer brief OSPF Process 1 with Router ID 3.3.3.3 Peer Statistic Information ---------------------------------------------------------------------------- Area Id Interface Neighbor id State 0.0.0.0 GigabitEthernet0/0/0 4.4.4.4 Full 0.0.0.0 GigabitEthernet0/0/1 2.2.2.2 Full ----------------------------------------------------------------------------

在R2 R3 R4上查看路由表

display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Public routing table : OSPF Destinations : 3 Routes : 3 OSPF routing table status : Destinations : 3 Routes : 3 Destination/Mask Proto Pre Cost Flags NextHop Interface 3.3.3.3/32 OSPF 10 1 D 192.168.23.3 GigabitEthernet0/0/1 4.4.4.4/32 OSPF 10 2 D 192.168.23.3 GigabitEthernet0/0/1 192.168.34.0/24 OSPF 10 2 D 192.168.23.3 GigabitEthernet0/0/1 OSPF routing table status : Destinations : 0 Routes : 0

display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Public routing table : OSPF Destinations : 2 Routes : 2 OSPF routing table status : Destinations : 2 Routes : 2 Destination/Mask Proto Pre Cost Flags NextHop Interface 2.2.2.2/32 OSPF 10 1 D 192.168.23.2 GigabitEthernet0/0/1 4.4.4.4/32 OSPF 10 1 D 192.168.34.4 GigabitEthernet0/0/0 OSPF routing table status : Destinations : 0 Routes : 0

display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Public routing table : OSPF Destinations : 3 Routes : 3 OSPF routing table status : Destinations : 3 Routes : 3 Destination/Mask Proto Pre Cost Flags NextHop Interface 2.2.2.2/32 OSPF 10 2 D 192.168.34.3 GigabitEthernet0/0/0 3.3.3.3/32 OSPF 10 1 D 192.168.34.3 GigabitEthernet0/0/0 192.168.23.0/24 OSPF 10 2 D 192.168.34.3 GigabitEthernet0/0/0 OSPF routing table status : Destinations : 0 Routes : 0

检查BGP的邻居关系R1和R2之间的EBGP关系

display bgp peer BGP local router ID : 1.1.1.1 Local AS number : 100 Total number of peers : 1 Peers in established state : 1 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 192.168.12.2 4 200 17 18 0 00:14:39 Established 1

R2的R1的EBGP关系 R2和R4跨邻居的IBGP关系

display bgp peer BGP local router ID : 2.2.2.2 Local AS number : 200 Total number of peers : 2 Peers in established state : 2 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 4.4.4.4 4 200 17 18 0 00:14:22 Established 1 192.168.12.1 4 100 18 18 0 00:15:02 Established 1

R4和R2的IBGP关系 R4和R5的EBGP关系

display bgp peer BGP local router ID : 4.4.4.4 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 17 17 0 00:14:49 Established 1 192.168.45.5 4 300 18 18 0 00:15:21 Established 1

R5和R4的EBGP关系

display bgp peer BGP local router ID : 5.5.5.5 Local AS number : 300 Total number of peers : 1 Peers in established state : 1 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 192.168.45.4 4 200 18 19 0 00:15:34 Established 1

路由黑洞实验现象在R1的BGP里面宣告1.1.1.1在R5的BGP里面宣告5.5.5.5

# bgp 100 network 1.1.1.1 255.255.255.255 #

# bgp 300 network 5.5.5.5 255.255.255.255 #

在R2上面查看是否学习到关于1.1.1.1和5.5.5.5的BGP路由

display bgp routing-table BGP Local router ID is 2.2.2.2 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 *> 1.1.1.1/32 192.168.12.1 0 0 100i *>i 5.5.5.5/32 4.4.4.4 0 100 0 300i

在R4上面查看是否学习到关于1.1.1.1和5.5.5.5的BGP路由

display bgp routing-table BGP Local router ID is 4.4.4.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 2.2.2.2 0 100 0 100i *> 5.5.5.5/32 192.168.45.5 0 0 300i

R4到达1.1.1.1的下一跳是2.2.2.2 因为在R2这边敲了如下命令

# bgp 200 peer 4.4.4.4 next-hop-local #

在R5上面查看是否学习到关于1.1.1.1的BGP路由

[R5]display bgp routing-table BGP Local router ID is 5.5.5.5 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 *> 1.1.1.1/32 192.168.45.4 0 200 100i *> 5.5.5.5/32 0.0.0.0 0 0 i [R5]

在R5设备上去访问1.1.1.1

[R5]ping -a 5.5.5.5 1.1.1.1 PING 1.1.1.1: 56 data bytes, press CTRL_C to break Request time out Request time out Request time out Request time out Request time out --- 1.1.1.1 ping statistics --- 5 packet(s) transmitted 0 packet(s) received 100.00% packet loss

在R5设备上去访问tracert 1.1.1.1

tracert -a 5.5.5.5 1.1.1.1 traceroute to 1.1.1.1(1.1.1.1), max hops: 30 ,packet length: 40,press CTRL_C to break 1 192.168.45.4 50 ms 40 ms 20 ms //发现到R4就停止了 2 * * * 3 * *

发现数据包交给R4后 R4后面就不通了 我们看下R4到达1.1.1.1的路由表

display ip routing-table 1.1.1.1 Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Routing Table : Public Summary Count : 1 Destination/Mask Proto Pre Cost Flags NextHop Interface 1.1.1.1/32 IBGP 255 0 RD 2.2.2.2 GigabitEthernet0/0/0

发现R4到达1.1.1.1的下一跳是2.2.2.2 R4上面到达2.2.2.2也是非直连网段 R4会递归查询到达2.2.2.2 发现到达2.2.2.2下一跳是R3 因为R4到达1.1.1.1的时候 数据包经过递归后 下一跳是R3

display ip routing-table 2.2.2.2 Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Routing Table : Public Summary Count : 1 Destination/Mask Proto Pre Cost Flags NextHop Interface 2.2.2.2/32 OSPF 10 2 D 192.168.34.3 GigabitEthernet0/0/0

R4会把数据包交给R3 R3收到后 到达1.1.1.1该如何走呢?

display ip routing-table 1.1.1.1

发现R3路由表里面根本就没有到达1.1.1.1的路由条目 所以R5访问1.1.1.1就会丢包 R3就像一个吃人的老虎机一样 只要是R5想要访问到R1这边 都会被R3的路由黑洞给吃掉 这个就是路由黑洞分析原因原因1:因为R3上没有运行BGP协议原因2:BGP可以跨邻居建立


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:自己的故事-什么是网络(有关网络的故事)
下一篇:迅速学会@ConfigurationProperties的使用操作
相关文章

 发表评论

暂时没有评论,来抢沙发吧~