1.划分IP地址
172.16.0.0/24 ——30 骨干
172.16.1.0/24 ——32 建邻环回
172.16.2.0——172.16.7.0/24 用户网段
R7上的配置
2.①在AS2区域启动ospf协议
[r7]ospf 1 router-id 7.7.7.7
[r7-ospf-1]area 0
[r7-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
②将用户网段从32位改为24位,将环回接口改为broadcast
[r7]int LoopBack 1
[r7-LoopBack1]ospf network-type broadcast
3.启动bgp协议
[r2]bgp 64512
[r2-bgp]router-id 2.2.2.2
[r2-bgp]confederation id 2
[r2-bgp]confederation peer-as 64513
bgp邻居表
4.解决水平分割
R3上
[r3]bgp 64512
[r3-bgp]peer 172.16.2.1 reflect-client
R6上
[r6]bgp 64513
[r6-bgp]peer 172.16.7.1 reflect-client
5、在r2上做防环处理,汇总以及路由宣告
[r2]ip route-static 172.16.0.0 21 NULL 0
[r2]bgp 64512
[r2-bgp]network 172.16.0.0 21
6、建立r1和r8的GRE,实现两个环回的通讯
[r1]int t0/0/0
[r1-Tunnel0/0/0]ip a 192.168.10.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre
[r1-Tunnel0/0/0]source 10.0.0.1
[r1-Tunnel0/0/0]destination 11.0.0.1
[r1]ip route-static 192.168.1.0 24 99.0.0.2