HCIP BGP实验 2
先按照网络拓扑图配好ip和环回
在r2---->r7上配置ospf
例如 r2
[r2]ospf 1 router-id 1.1.1.1
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 2.2.2.0 0.0.0.255
[r2-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[r2-ospf-1-area-0.0.0.0]network 25.1.1.0 0.0.0.255
然后配置BGP
在配置bgp
配置ebgp
例如 r1
[r1]bgp 1
[r1-bgp]router-id 1.1.1.1
[r1-bgp]peer 12.1.1.2 as-number 2
[r1-bgp]peer 2.2.2.2 ebgp-max-hop 2
配置ibgp
r2 r3 r4为一个联邦
r5 r6 r7为一个联邦
例如 r3
[r3]bgp 64512
[r3-bgp]router-id 3.3.3.3
[r3-bgp]confederation id 2 申明本地的大AS号
[r3-bgp]confederation peer-as 64513 告知本地直连的其他小AS号,若没有直连到其他小
AS不用配置
[r3-bgp]peer 2.2.2.2 as-number 64512
[r3-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[r3-bgp]peer 4.4.4.4 as-number 64513
[r3-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[r3-bgp]peer 4.4.4.4 ebgp-max-hop
[r2-bgp]peer 4.4.4.4 next-hop-local
[r7-bgp]peer 5.5.5.5 next-hop-local
再在3 4 5 6 上做反射器
例如r3
[r3-bgp]peer 2.2.2.2 reflect-client