要求:
1.AS1存在两个环回,一个地址为192.168.1.0/24该地址不能在任何协议中宣告,AS3中存在两个环回,一个地址为192.168.2.0/24该地址不能在任何协议中宣告,最终要求这两个环回可以互相通讯,AS1的另一个环回为10.0.0.0/24,AS3的另一个环回为11.0.0.0/24
2.整个AS2的IP地址为172.16.0.0/16,请合理划分
3.AS间的骨干链路IP地址随意定制
4.使用BGP协议让整个网络所有设备的环回可以互相访问
5.减少路由条目数量,避免环路出现
配置IP地址
R1
[R1]user-interface c0
[R1-ui-console0]idle-timeout 0 0[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 12.0.0.1 24
[R1-GigabitEthernet0/0/0]int l0
[R1-LoopBack0]ip add 192.168.1.1 24
[R1-LoopBack0]int l1
[R1-LoopBack1]ip add 10.0.0.1 24R2
[R2]user-interface c0
[R2-ui-console0]idle-timeout 0 0[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[R2-GigabitEthernet0/0/0]int l0
[R2-LoopBack0]ip add 172.16.2.1 24
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 172.16.1.1 29
[R2-GigabitEthernet0/0/1]int g0/0/2
[R2-GigabitEthernet0/0/2]ip add 172.16.1.9 29R3
[R3]user-interface c0
[R3-ui-console0]idle-timeout 0 0[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 172.16.1.2 29
[R3-GigabitEthernet0/0/0]int l0
[R3-LoopBack0]ip add 172.16.3.1 24
[R3-LoopBack0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 172.16.1.17 29R4
[R4]user-interface c0
[R4-ui-console0]idle-timeout 0 0[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 172.16.1.18 29
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 172.16.1.25 29
[R4-GigabitEthernet0/0/1]int l0
[R4-LoopBack0]ip add 172.16.4.1 24R5
[R5]user-interface c0
[R5-ui-console0]idle-timeout 0 0[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 172.16.1.10 29
[R5-GigabitEthernet0/0/0]int g0/0/1
[R5-GigabitEthernet0/0/1]ip add 172.16.1.133 29
[R5-GigabitEthernet0/0/1]int l0
[R5-LoopBack0]ip add 172.16.5.1 24R6
[R6]user-interface c0
[R6-ui-console0]idle-timeout 0 0[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip add 172.16.1.34 29
[R6-GigabitEthernet0/0/0]int l0
[R6-LoopBack0]ip add 172.16.6.1 24
[R6-LoopBack0]int g0/0/1
[R6-GigabitEthernet0/0/1]ip add 172.16.1.41 29R7
[R7]user-interface c0
[R7-ui-console0]idle-timeout 0 0[R7]int g0/0/0
[R7-GigabitEthernet0/0/0]ip add 172.16.1.42 29
[R7-GigabitEthernet0/0/0]int l0
[R7-LoopBack0]ip add 172.16.7.1 24
[R7-LoopBack0]int g0/0/1
[R7-GigabitEthernet0/0/1]ip add 172.16.1.26 29
[R7-GigabitEthernet0/0/1]int g0/0/2
[R7-GigabitEthernet0/0/2]ip add 78.0.0.1 24R8
[R8]user-interface c0
[R8-ui-console0]idle-timeout 0 0[R8]int g0/0/0
[R8-GigabitEthernet0/0/0]ip add 78.0.0.2 24
[R8-GigabitEthernet0/0/0]int l0
[R8-LoopBack0]ip add 192.168.2.1 24
[R8-LoopBack0]int l1
[R8-LoopBack1]ip add 11.0.0.1 24
R2
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]a 0
[R2-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255R3
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255R4
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]a 0
[R4-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255R5
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]a 0
[R5-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255R6
[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1]a 0
[R6-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255R7
[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]a 0
[R7-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
全部启用BGP协议并建立对等体
R1
[R1]bgp 1
[R1-bgp]route-select
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 12.0.0.2 as 2R2
[R2]bgp 64512
[R2-bgp]route-select
[R2-bgp]router-id 2.2.2.2
[R2-bgp]confederation id 2
[R2-bgp]confederation peer-as 64513
[R2-bgp]peer 12.0.0.1 as 1
[R2-bgp]peer 172.16.3.1 as 64512
[R2-bgp]peer 172.16.3.1 connect-interface LoopBack 0
[R2-bgp]peer 172.16.5.1 as 64513
[R2-bgp]peer 172.16.5.1 connect-interface LoopBack 0
[R2-bgp]peer 172.16.5.1 ebgp-max-hop 2
[R2-bgp]peer 172.16.3.1 next-hop-local
[R2-bgp]peer 172.16.5.1 next-hop-localR3
[R3]bgp 64512
[R3-bgp]router-id 3.3.3.3
[R3-bgp]confederation id 2
[R3-bgp]peer 172.16.2.1 as 64512
[R3-bgp]peer 172.16.2.1 connect-interface LoopBack 0
[R3-bgp]peer 172.16.4.1 as 64512
[R3-bgp]peer 172.16.4.1 connect-interface LoopBack 0R4
[R4]bgp 64512
[R4-bgp]router-id 4.4.4.4
[R4-bgp]confederation id 2
[R4-bgp]confederation peer-as 64513
[R4-bgp]peer 172.16.3.1 as 64512
[R4-bgp]peer 172.16.3.1 connect-interface LoopBack 0
[R4-bgp]peer 172.16.7.1 as 64513
[R4-bgp]peer 172.16.7.1 connect-interface LoopBack 0
[R4-bgp]peer 172.16.7.1 ebgp-max-hop 2R5
[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 172.16.2.1 as 64512
[R5-bgp]peer 172.16.2.1 connect-interface LoopBack 0
[R5-bgp]peer 172.16.2.1 ebgp-max-hop 2
[R5-bgp]peer 172.16.6.1 as 64513
[R5-bgp]peer 172.16.6.1 connect-interface LoopBack 0R6
[R6]bgp 64513
[R6-bgp]router-id 6.6.6.6
[R6-bgp]confederation id 2
[R6-bgp]peer 172.16.5.1 as 64513
[R6-bgp]peer 172.16.5.1 connect-interface LoopBack 0
[R6-bgp]peer 172.16.7.1 as 64513
[R6-bgp]peer 172.16.7.1 connect-interface LoopBack 0R7
[R7]bgp 64513
[R7-bgp]router-id 7.7.7.7
[R7-bgp]confederation id 2
[R7-bgp]confederation peer-as 64512
[R7-bgp]peer 172.16.6.1 as 64513
[R7-bgp]peer 172.16.6.1 connect-interface LoopBack 0
[R7-bgp]peer 172.16.4.1 as 64512
[R7-bgp]peer 172.16.4.1 connect-interface LoopBack 0
[R7-bgp]peer 172.16.4.1 ebgp-max-hop 2
[R7-bgp]peer 78.0.0.2 as 3
[R7-bgp]peer 172.16.4.1 next-hop-local
[R7-bgp]peer 172.16.6.1 next-hop-localR8
[R8]bgp 3
[R8-bgp]router-id 8.8.8.8
[R8-bgp]peer 78.0.0.1 as 2
发布路由信息
R1
[R1]bgp 1
[R1-bgp]network 10.0.0.0 24R8
[R8]bgp 3
[R8-bgp]network 11.0.0.0 24
破除IBGP之间的水平分割,配置路由反射器
R3
[R3]bgp 64512
[R3-bgp]peer 172.16.2.1 reflect-clientR6
[R6]bgp 64513
[R6-bgp]peer 172.16.7.1 reflect-client
AS1与AS3环回互通AS1与AS3环回互通
R1
[R1]int t0/0/0
[R1-Tunnel0/0/0]ip add 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.2R8
[R8]int t0/0/0
[R8-Tunnel0/0/0]ip add 192.168.10.2 24
[R8-Tunnel0/0/0]tunnel-protocol gre
[R8-Tunnel0/0/0]source 11.0.0.1
[R8-Tunnel0/0/0]destination 10.0.0.1
[R8]ip route-static 192.168.2.0 24 99.0.0.1