标签:解决 number 下一跳 int router code ext alt next
AR1配置:
bgp 10
router-id 10.0.1.1
peer 10.0.12.2 as-number 20
ipv4-family unicast
undo synchronization
network 10.0.1.1 255.255.255.255
network 10.0.12.0 255.255.255.0
peer 10.0.12.2 enable
配置next-hop-local原因是:IBGP从EBGP学习到路由下一跳不变,会导致下一跳不可达,所以IBGP配置local,告知下一跳是自己。
AR2:
bgp 20
router-id 10.0.2.2
peer 10.0.4.4 as-number 20
peer 10.0.4.4 connect-interface LoopBack0
peer 10.0.12.1 as-number 10
ipv4-family unicast
undo synchronization
peer 10.0.4.4 enable
peer 10.0.4.4 next-hop-local
peer 10.0.12.1 enable
AR4:
bgp 20
router-id 10.0.4.4
peer 10.0.2.2 as-number 20
peer 10.0.2.2 connect-interface LoopBack0
peer 10.0.45.5 as-number 30
ipv4-family unicast
undo synchronization
peer 10.0.2.2 enable
peer 10.0.2.2 next-hop-local
peer 10.0.45.5 enable
AR5:
bgp 30
router-id 10.0.5.5
peer 10.0.45.4 as-number 20
ipv4-family unicast
undo synchronization
network 10.0.5.5 255.255.255.255
network 10.0.45.0 255.255.255.0
peer 10.0.45.4 enable
AR2,AR3,AR4配置OSPF 1
ospf 1 router-id 10.0.0.2
area 0.0.0.0
network 10.0.2.2 0.0.0.0
network 10.0.23.0 0.0.0.255
ospf 1 router-id 10.0.0.3
area 0.0.0.0
network 10.0.3.3 0.0.0.0
network 10.0.23.0 0.0.0.255
network 10.0.34.0 0.0.0.255
ospf 1 router-id 10.0.0.4
area 0.0.0.0
network 10.0.4.4 0.0.0.0
network 10.0.34.0 0.0.0.255
根据BGP第四条选路原则,当IBGP学到的路由传递给BGP邻居之前通过IGP必须知道该路由,也就是说,AR2学习到的AR1的的路由传递给AR4时,改路由经过AR3,AR3必须知道AR1的路由;同理也必须知道AR5的路由,可以通过IBGP全互联和OSPF 引入BGP解决此问题;
办法1 ospf引入bgp(如果是公网bgp,不建议这么搞,除非你路由器和运维能力很牛逼):
AR2和AR4分别:
bgp 20
import-route bgp
办法2 IBGP全互联:
AR2:
bgp 20
router-id 10.0.2.2
peer 10.0.3.3 as-number 20
peer 10.0.3.3 connect-interface LoopBack0
peer 10.0.4.4 as-number 20
peer 10.0.4.4 connect-interface LoopBack0
ipv4-family unicast
undo synchronization
peer 10.0.3.3 enable
peer 10.0.3.3 next-hop-local
peer 10.0.4.4 enable
peer 10.0.4.4 next-hop-local
AR3:
bgp 20
router-id 10.0.3.3
peer 10.0.2.2 as-number 20
peer 10.0.2.2 connect-interface LoopBack0
peer 10.0.4.4 as-number 20
peer 10.0.4.4 connect-interface LoopBack0
ipv4-family unicast
undo synchronization
peer 10.0.2.2 enable
peer 10.0.4.4 enable
AR4:bgp 20
router-id 10.0.4.4
peer 10.0.2.2 as-number 20
peer 10.0.2.2 connect-interface LoopBack0
peer 10.0.3.3 as-number 20
peer 10.0.3.3 connect-interface LoopBack0
ipv4-family unicast
undo synchronization
peer 10.0.2.2 enable
peer 10.0.2.2 next-hop-local
peer 10.0.3.3 enable
peer 10.0.3.3 next-hop-local
标签:解决 number 下一跳 int router code ext alt next
原文地址:https://blog.51cto.com/19940820/2536316