1234跑RIP,5678跑OSPF
BGP建邻
IBGP之间用环回建邻
EBGP之间用直连建邻(小AS号之间一定要写ebgp-max-hop,因为是类ebgp邻居)
bgp 64512
confederation id 100
confederation peer-as 64513
peer 2.2.2.2 as-number 64512
peer 2.2.2.2 connect-interface LoopBack0
peer 4.4.4.4 as-number 64513
peer 4.4.4.4 ebgp-max-hop 255
peer 4.4.4.4 connect-interface LoopBack0
在2和7上做反射器
bgp 64512
ipv4-family unicast
peer 1.1.1.1 reflect-client
peer 3.3.3.3 reflect-client
(真机上做了反射器,在RR端和客户端next-hop-local会失效,使用Route-Policy代替)
route-policy xx permit node 10
apply ip-address next-hop peer-address
bgp 64512
peer 1.1.1.1 route-policy xx export
peer 3.3.3.3 route-policy xx export
R1访问8的环回走R5使用Preferred-value值
ip ip-prefix f index 10 permit 8.8.8.8 32
route-policy g permit node 10
if-match ip-prefix f
apply preferred-value 1
route-policy g permit node 20
R8访问1的环回走R4用As-path
ip ip-prefix as index 10 permit 1.1.1.1 32
route-policy as permit node 10
if-match ip-prefix as
apply as-path 100 100 100 additive
route-policy as permit node 20
9访问1走R8
ip ip-prefix med index 10 permit 1.1.1.1 32
route-policy med permit node 10
if-match ip-prefix med
apply cost 10