HCIP-BGP通告原则

  |   0 评论   |   0 浏览

image.png
BGP通告原则:

  1. 仅将自己最优的路由发布给邻居
  2. IBGP的原则是收到IBGP邻居的路由不发送给IBGP邻居,防止IBGP环路(通过IBGP获得的最优路由不会发布给其他的IBGP邻居)(IBGP水平分割)
    a.防止IBGP环路(AS内部环路):IBGP水平分割
    b.防止EBGP环路(不同AS之间的环路):AS-path属性
    解决IBGP水平分割代理的路由不传递问题:
    a.在AS内部IBGP邻居建立全互联结构(full-mesh)
    b.配置路由反射器RR
    [R5-bgp]peer 10.6.4.4 reflect-client //配置R4为R5的反射客户端
    refresh bgp all export //刷新
    c.BGP联盟
  3. 通过EBGP获得的最优路由会发布给所有BGP邻居
  4. BGP和IGP同步(华为默认关闭)
  5. 默认从EBGP邻居学到的BGP路由的下一跳是EBGP对等体的IP地址,路由传递给IBGP邻居时下一跳地址不变(还是上一个AS的接口地址),此时有可能会引发下一跳不可达。
    解决下一跳不可达:
    a.将EBGP互联地址(next-hop)宣告到IGP(注意配置静默接口,防止IGP路由传递到其他AS)
    b.使用next-hop属性 //[R2-bgp]peer 10.6.5.5 next-hop-local
[R1]bgp 100
[R1-bgp]peer 10.1.3.3 as-number 100
[R1-bgp]peer 10.1.3.3 connect-interface loopback 0
[R1-bgp]peer 10.1.2.2 as-number 100
[R1-bgp]peer 10.1.2.2 connect-interface loopback 0


[R2]interface loopback 0
[R2-LoopBack0]ip add 10.1.2.2 24
[R2-LoopBack0]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip add 10.1.12.2 25
[R2-GigabitEthernet0/0/0]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip add 200.1.26.2 25
[R2-GigabitEthernet0/0/1]interface g0/0/2
[R2-GigabitEthernet0/0/2]ip add 200.1.27.2 25
[R2-GigabitEthernet0/0/2]interface g4/0/0
[R2-GigabitEthernet4/0/0]ip add 200.1.28.2 25
[R2-GigabitEthernet4/0/0]interface g4/0/1
[R2-GigabitEthernet4/0/1]ip add 200.1.25.2 25
[R2-GigabitEthernet4/0/0]interface g4/0/2
[R2-GigabitEthernet4/0/1]ip add 200.1.23.2 25
[R2-GigabitEthernet4/0/1]q
[R2]router id 2.2.2.2
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.1.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.1.12.2 0.0.0.0
[R2]bgp 100
[R2-bgp]peer 10.1.1.1 as-number 100
[R2-bgp]peer 10.1.1.1 connect-interface loopback 0
[R2-bgp]peer 200.1.26.6 as-number 200
[R2-bgp]peer 200.1.27.7 as-number 300


[R3]interface loopback 0
[R3-LoopBack0]ip add 10.1.3.3 24
[R3-LoopBack0]interface g0/0/0
[R3-GigabitEthernet0/0/0]ip add 10.1.13.3 25
[R3-GigabitEthernet0/0/0]interface g0/0/1
[R3-GigabitEthernet0/0/1]ip add 200.1.36.3 25
[R3-GigabitEthernet0/0/1]interface g0/0/2
[R3-GigabitEthernet0/0/2]ip add 200.1.37.3 25
[R3-GigabitEthernet0/0/2]interface g4/0/0
[R3-GigabitEthernet4/0/0]ip add 200.1.38.3 25
[R3-GigabitEthernet4/0/0]interface g4/0/1
[R3-GigabitEthernet4/0/1]ip add 200.1.35.3 25
[R3-GigabitEthernet4/0/1]interface g4/0/2
[R3-GigabitEthernet4/0/2]ip add 200.1.23.3 25
[R3-GigabitEthernet4/0/2]q
[R3]router id 3.3.3.3
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.1.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 10.1.13.3 0.0.0.0
[R3]bgp 100
[R3-bgp]peer 10.1.1.1 as-number 100
[R3-bgp]peer 10.1.1.1 connect-interface loopback 0
[R3-bgp]peer 200.1.36.6 as-number 200
[R3-bgp]peer 200.1.37.7 as-number 300


[R4]interface loopback 0
[R4-LoopBack0]ip add 10.6.4.4 24
[R4-LoopBack0]interface g0/0/0
[R4-GigabitEthernet0/0/0]ip add 10.6.45.4 25
[R4-GigabitEthernet0/0/0]q
[R4]router id 4.4.4.4
[R4]ospf 1
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 10.6.45.4 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 10.6.4.4 0.0.0.0
[R4]bgp 200
[R4-bgp]peer 10.6.5.5 as-number 200
[R4-bgp]peer 10.6.5.5 connect-interface LoopBack 0



[R5]interface loopback 0
[R5-LoopBack0]ip add 10.6.5.5 24
[R5-LoopBack0]interface g0/0/1
[R5-GigabitEthernet0/0/1]ip add 10.6.45.5 25
[R5-GigabitEthernet0/0/1]interface g0/0/0
[R5-GigabitEthernet0/0/0]ip add 10.6.56.5 25
[R5-GigabitEthernet0/0/0]interface g0/0/2
[R5-GigabitEthernet0/0/2]ip add 200.1.25.5 25
[R5-GigabitEthernet0/0/2]interface g4/0/0
[R5-GigabitEthernet4/0/0]ip add 200.1.35.5 25
[R5-GigabitEthernet4/0/0]q
[R5]router id 5.5.5.5
[R5]ospf 1
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 10.6.45.5 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 10.6.56.5 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 10.6.25.5 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 10.6.35.5 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 10.6.5.5 0.0.0.0
[R5-ospf-1-area-0.0.0.0]q
[R5-ospf-1]silent-interface g0/0/2
[R5-ospf-1]silent-interface g4/0/0
[R5]bgp 200
[R5-bgp]peer 10.6.4.4 as-number 200
[R5-bgp]peer 10.6.4.4 connect-interface loopback 0
[R5-bgp]peer 10.6.6.6 as-number 200
[R5-bgp]peer 10.6.6.6 connect-interface LoopBack 0


[R6]interface g0/0/1
[R6-GigabitEthernet0/0/1]ip add 10.6.56.6 25
[R6-GigabitEthernet0/0/1]interface g0/0/0
[R6-GigabitEthernet0/0/0]ip add 200.1.26.6 25
[R6-GigabitEthernet0/0/0]interface g0/0/2
[R6-GigabitEthernet0/0/2]ip add 200.1.36.6 25
[R6-GigabitEthernet0/0/2]interface loopback 0
[R6-LoopBack0]ip add 10.6.6.6 24
[R6]interface loopback 1
[R6-LoopBack1]ip add 10.6.66.6 24
[R6-LoopBack0]q
[R6]router id 6.6.6.6
[R6]ospf 1
[R6-ospf-1]silent-interface g0/0/0
[R6-ospf-1]silent-interface g0/0/2
[R6-ospf-1]area 0
[R6-ospf-1-area-0.0.0.0]network 10.6.56.6 0.0.0.0
[R6-ospf-1-area-0.0.0.0]network 200.1.26.6 0.0.0.0
[R6-ospf-1-area-0.0.0.0]network 200.1.36.6 0.0.0.0
[R6-ospf-1-area-0.0.0.0]network 10.6.6.6 0.0.0.0
[R6-ospf-1-area-0.0.0.0]network 10.6.66.6 0.0.0.0
[R6]bgp 200
[R6-bgp]peer 10.6.5.5 as-number 200
[R6-bgp]peer 10.6.5.5 connect-interface LoopBack 0
[R6-bgp]peer 200.1.26.2 as-number 100
[R6-bgp]peer 200.1.36.3 as-number 100


[R7]interface loopback 0
[R7-LoopBack0]ip add 10.7.7.7 24
[R7-LoopBack0]interface g0/0/1
[R7-GigabitEthernet0/0/1]ip add 10.7.78.7 25
[R7-GigabitEthernet0/0/1]interface g0/0/0
[R7-GigabitEthernet0/0/0]ip add 200.1.27.7 25
[R7-GigabitEthernet0/0/0]interface g0/0/2
[R7-GigabitEthernet0/0/2]ip add 200.1.37.7 25
[R7-GigabitEthernet0/0/2]q
[R7]router id 7.7.7.7
[R7]ospf 1
[R7-ospf-1]area 0
[R7-ospf-1-area-0.0.0.0]network 10.7.7.7 0.0.0.0
[R7-ospf-1-area-0.0.0.0]network 10.7.78.7 0.0.0.0
[R7]bgp 300
[R7-bgp]peer 10.7.8.8 as-number 300
[R7-bgp]peer 10.7.8.8 connect-interface LoopBack 0
[R7-bgp]peer 200.1.27.2 as-number 100
[R7-bgp]peer 200.1.37.3 as-number 100


[R8]interface loopback 0
[R8-LoopBack0]ip add 10.7.8.8 24
[R8-LoopBack0]interface g0/0/0
[R8-GigabitEthernet0/0/0]ip add 10.7.78.8 25
[R8-GigabitEthernet0/0/0]interface g0/0/1
[R8-GigabitEthernet0/0/1]ip add 200.1.38.8 25
[R8-GigabitEthernet0/0/1]interface g0/0/2
[R8-GigabitEthernet0/0/2]ip add 200.1.28.8 25
[R8-GigabitEthernet0/0/2]q
[R8]router id 8.8.8.8
[R8]ospf 1
[R8-ospf-1]area 0
[R8-ospf-1-area-0.0.0.0]network 10.7.8.8 0.0.0.0
[R8-ospf-1-area-0.0.0.0]network 10.7.78.8 0.0.0.0
[R8]bgp 300
[R8-bgp]peer 10.7.7.7 as-number 300
[R8-bgp]peer 10.7.7.7 connect-interface LoopBack 0

image.png
image.png