1.配置ip
R1:
R2:
R3:
R4:
R5:
R6:
R7:
R8:
2.AS2中的ospf互通
R2:
R3:
R4:
R5:
R6:
R7:
3.BGP建邻
R1:
R2:
[R2]bgp 64512
[R2-bgp]confederation id 2
[R2-bgp]confederation peer-as 64513
[R2-bgp]peer 12.1.1.1 as 1
[R2-bgp]peer 172.16.1.2 as 64512
[R2-bgp]peer 172.16.1.2 next-hop-local
[R2-bgp]peer 172.16.1.22 as 64513
[R2-bgp]peer 172.16.1.22 next-hop-local
R3:
[R3]bgp 64512
[R3-bgp]confederation id 2
[R3-bgp]peer 172.16.1.1 as 64512
[R3-bgp]peer 172.16.1.1 next-hop-local
[R3-bgp]peer 172.16.1.6 as 64512
[R3-bgp]peer 172.16.1.6 next-hop-local
R4:
[R4]bgp 64512
[R4-bgp]confederation id 2
[R4-bgp]peer 172.16.1.5 as 64512
[R4-bgp]peer 172.16.1.5 next-hop-local
R5:
[R5]bgp 64513
[R5-bgp]confederation id 2
[R5-bgp]confederation peer-as 64512
[R5-bgp]peer 172.16.1.21 as 64512
[R5-bgp]peer 172.16.1.21 next-hop-local
[R5-bgp]peer 172.16.1.18 as 64513
[R5-bgp]peer 172.16.1.18 next-hop-local
R6:
[R6]bgp 64513
[R6-bgp]confederation id 2
[R6-bgp]peer 172.16.1.17 as 64513
[R6-bgp]peer 172.16.1.17 next-hop-local
[R6-bgp]peer 172.16.1.14 as 64513
[R6-bgp]peer 172.16.1.14 next-hop-local
R7:
[R7]bgp 64513
[R7-bgp]confederation id 2
[R7-bgp]peer 34.1.1.2 as 3
[R7-bgp]peer 34.1.1.2 next-hop-local
[R7-bgp]peer 172.16.1.13 as 64513
[R7-bgp]peer 172.16.1.13 next-hop-local
[R7-bgp]peer 172.16.1.9 as 64512
[R7-bgp]peer 172.16.1.9 next-hop-local
R8:
[R8]bgp 3
[R8-bgp]peer 34.1.1.1 as 2
4.做反射
[AR3]bgp 64512
[AR3-bgp]peer 172.16.1.6 reflect-client
[AR6]bgp 64513
[AR6-bgp]peer 172.16.1.18 reflect-client
5.路由汇总和防环
[R2]ip route-static 172.16.0.0 16 NULL 0
[R2]bgp 64512
[R2-bgp]network 172.16.0.0 16
[R7]ip route-static 172.16.0.0 16 NULL 0
[R7]bgp 64513
[R7-bgp]network 172.16.0.0 16
6.gre隧道
[R1]int t0/0/0
[R1-Tunnel0/0/0]ip add 10.1.1.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre
[R1-Tunnel0/0/0]source 172.16.0.1
[R1-Tunnel0/0/0]destination 172.16.0.8
[R8]int t0/0/0
[R8-Tunnel0/0/0]ip add 10.1.1.2 24
[R8-Tunnel0/0/0]tunnel-protocol gre
[R8-Tunnel0/0/0]source 172.16.0.8
[R8-Tunnel0/0/0]destination 172.16.0.1