配置ip
r1
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip address 12.0.0.1 24
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 10.0.0.1 24
[r1]interface lo 1
[r1-LoopBack1]ip address 192.168.1.1 24
配置完整ip
配置ospf
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 10.0.0.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 12.0.0.1 0.0.0.0
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 12.0.0.2 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 172.16.128.1 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 172.16.0.1 0.0.0.0
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 172.16.0.2 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 172.16.8.1 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 172.16.128.2 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 172.16.64.1 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 5.5.5.5 0.0.0.0
[r6]ospf 1 router-id 6.6.6.6
[r6-ospf-1]area 0
[r6-ospf-1-area-0.0.0.0]network 6.6.6.6 0.0.0.0
[r6-ospf-1-area-0.0.0.0]network 172.16.64.2 0.0.0.0
[r6-ospf-1-area-0.0.0.0]network 172.16.72.1 0.0.0.0
[r7]ospf 1 router-id 7.7.7.7
[r7-ospf-1]area 0
[r7-ospf-1-area-0.0.0.0]network 7.7.7.7 0.0.0.0
[r7-ospf-1-area-0.0.0.0]network 172.16.72.2 0.0.0.0
[r7-ospf-1-area-0.0.0.0]network 172.16.192.2 0.0.0.0
[r7-ospf-1-area-0.0.0.0]network 78.0.0.1 0.0.0.0
[r8]ospf 1 router-id 8.8.8.8
[r8-ospf-1]area 0
[r8-ospf-1-area-0.0.0.0]network 78.0.0.2 0.0.0.
[r8-ospf-1-area-0.0.0.0]network 11.0.0.1 0.0.0.0
r1与r2之间建立ebgp
[r1]bgp 1
[r1-bgp]router-id 10.0.0.1
[r1-bgp]peer 12.0.0.2 as-number 2
[r2]bgp 64512
[r2-bgp]router-id 2.2.2.2
[r2-bgp]confederation id 2
[r2-bgp]peer 12.0.0.1 as 1
r7与r8之间建立
[r7]bgp 64513
[r7-bgp]router-id 7.7.7.7
[r7-bgp]confederation id 2
[r7-bgp]peer 78.0.0.2 as-number 3
[r8]bgp 3
[r8-bgp]router-id 11.0.0.1
[r8-bgp]peer 78.0.0.1 as 2
r2,r3,r4建立联邦
[r2]bgp 64512
[r2-bgp]router-id 2.2.2.2
[r2-bgp]confederation id 2
[r2-bgp]peer 3.3.3.3 as-number 64512
[r2-bgp]peer 3.3.3.3 connect-interface lo 0
[r2-bgp]peer 3.3.3.3 next-hop-local
[r3]bgp 64512
[r3-bgp]router-id 3.3.3.3
[r3-bgp]confederation id 2
[r3-bgp]peer 2.2.2.2 as-number 64512
[r3-bgp]peer 2.2.2.2 connect-interface lo 0
[r3-bgp]peer 4.4.4.4 as 64512
[r3-bgp]peer 4.4.4.4 connect-interface lo 0
[r4]bgp 64512
[r4-bgp]router-id 4.4.4.
[r4-bgp]confederation id 2
[r4-bgp]peer 3.3.3.3 as-number 64512
[r4-bgp]peer 3.3.3.3 connect-interface lo 0
r5,r6,r7之间建立联邦
[r7]bgp 64513
[r7-bgp]router-id 7.7.7.7
[r7-bgp]confederation id 2
[r7-bgp]peer 6.6.6.6 as 64513
[r7-bgp]peer 6.6.6.6 connect-interface LoopBack 0
[r7-bgp]peer 6.6.6.6 next-hop-local
[r5]bgp 64513
[r5-bgp]router-id 5.5.5.5
[r5-bgp]confederation id 2
[r5-bgp]peer 6.6.6.6 as-number 64513
[r5-bgp]peer 6.6.6.6 connect-interface lo 0
[r5-bgp]confederation peer-as 64513
[r6]bgp 64513
[r6-bgp]router-id 6.6.6.6
[r6-bgp]confederation id 2
[r6-bgp]peer 7.7.7.7 as 64513
[r6-bgp]peer 7.7.7.7 connect-interface lo 0
[r6-bgp]confederation peer-as 64513
[r6-bgp]peer 5.5.5.5 as 64513
[r6-bgp]peer 5.5.5.5 connect-interface lo 0
[r6-bgp]confederation peer-as 64513
r2与r5之间
[r2]bgp 64512
[r2-bgp]router-id 2.2.2.2
[r2-bgp]confederation id 2
[r2-bgp]confederation peer-as 64513
[r2-bgp]peer 5.5.5.5 as-number 64513
[r2-bgp]peer 5.5.5.5 connect-interface lo 0
[r2-bgp]peer 5.5.5.5 ebgp-max-hop
[r5]bgp 64513
[r5-bgp]router-id 5.5.5.5
[r5-bgp]confederation id 2
[r5-bgp]confederation peer-as 64512
[r5-bgp]peer 2.2.2.2 as-number 64512
[r5-bgp]peer 2.2.2.2 connect-interface lo 0
[r5-bgp]peer 2.2.2.2 ebgp-max-hop
[r5-bgp]peer 2.2.2.2 next-hop-local
r4与r7之间建立
[r7]bgp 64513
[r7-bgp]confederation peer-as 64512
[r7-bgp]peer 4.4.4.4 as-number 64512
[r7-bgp]peer 4.4.4.4 connect-interface lo 0
[r7-bgp]peer 4.4.4.4 ebgp-max-hop
[r7-bgp]peer 4.4.4.4 next-hop-local
[r4]bgp 64512
[r4-bgp]confederation peer-as 64513
[r4-bgp]peer 7.7.7.7 as-number 64513
[r4-bgp]peer 7.7.7.7 connect-interface lo 0
[r4-bgp]peer 7.7.7.7 ebgp-max-hop
将本地设置为RR
[r3]bgp 64512
[r3-bgp]peer 2.2.2.2 reflect-client
[r6]bgp 64513
[r6-bgp]peer 5.5.5.5 reflect-client
检测:访问r8的环回