要求:
1、
1.1AS 1存在两个环回,一个环回地址为192.168.1.0/24,该地址不能宣告在任何协议
1.2AS 3存在两个环回,一个环回地址是192.168.2.0/24,该地址不能宣告在任何协议
1.3AS 1还有一个环回地址是10.1.1.0/24,AS 3另一个环回地址是11.1.1.0/24;最终实现这两个环回可以互相通讯
2、整个AS 2IP地址为172.16.0.0/16
3、AS之间的骨干链路IP地址随意分配
4、使用BGP协议让整个网络所有设备的环回可以相互访问
5、减少路由条目数量,避免环路产生
分析:
1、分配AS 2IP地址
172.16.0.0/19----->R2-R3
172.16.32.0/19----->R3-R4
172.16.64.0/19----->R2-R5
172.16.96.0/19----->R4-R7
172.16.128.0/19----->R5-R6
172.16.160.0/19----->R6-R7
172.16.192.0/19----->保留
172.16.224.0/19----->保留
2、配置IP及环回
AR1
[AR1]int g 0/0/0
[AR1-GigabitEthernet0/0/0]ip add 12.0.0.1 24
[AR1-GigabitEthernet0/0/0]int l 0
[AR1-LoopBack0]ip add 10.1.1.1 24
[AR1-LoopBack0]int l 1
[AR1-LoopBack1]ip add 192.168.1.1 24
AR2
[AR2]int g 0/0/0
[AR2-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[AR2-GigabitEthernet0/0/0]int g 0/0/1
[AR2-GigabitEthernet0/0/1]ip add 172.16.0.2 19
[AR2-GigabitEthernet0/0/1]int g 0/0/2
[AR2-GigabitEthernet0/0/2]ip add 172.16.64.2 19[AR2]int l 0
[AR2-LoopBack0]ip add 2.2.2.2 32
AR3
[AR3]int g 0/0/0
[AR3-GigabitEthernet0/0/0]ip add 172.16.0.3 19
[AR3-GigabitEthernet0/0/0]int g 0/0/1
[AR3-GigabitEthernet0/0/1]ip add 172.16.32.3 19[AR3]int l 0
[AR3-LoopBack0]ip add 3.3.3.3 32
AR4
[AR4]int g 0/0/0
[AR4-GigabitEthernet0/0/0]ip add 172.16.32.4 19
[AR4-GigabitEthernet0/0/0]int g 0/0/1
[AR4-GigabitEthernet0/0/1]ip add 172.16.96.4 19[AR4]int l 0
[AR4-LoopBack0]ip add 4.4.4.4 32
AR5
[AR5]int g 0/0/0
[AR5-GigabitEthernet0/0/0]ip add 172.16.64.5 19
[AR5-GigabitEthernet0/0/0]int g 0/0/1
[AR5-GigabitEthernet0/0/1]ip add 172.16.128.5 19[AR5]int l 0
[AR5-LoopBack0]ip add 5.5.5.5 32
AR6
[AR6]int g 0/0/0
[AR6-GigabitEthernet0/0/0]ip add 172.16.128.6 19
[AR6-GigabitEthernet0/0/0]int g 0/0/1
[AR6-GigabitEthernet0/0/1]ip add 172.16.160.6 19[AR6]int l 0
[AR6-LoopBack0]ip add 6.6.6.6 32
AR7
[AR7]int g 0/0/0
[AR7-GigabitEthernet0/0/0]ip add 172.16.96.7 19
[AR7-GigabitEthernet0/0/0]int g 0/0/1
[AR7-GigabitEthernet0/0/1]ip add 172.16.160.7 19
[AR7-GigabitEthernet0/0/1]int g 0/0/2
[AR7-GigabitEthernet0/0/2]ip add 78.0.0.7 24[AR7]int l 0
[AR7-LoopBack0]ip add 7.7.7.7 32
AR8
[AR8]int g 0/0/0
[AR8-GigabitEthernet0/0/0]ip add 78.0.0.8 24
[AR8-GigabitEthernet0/0/0]int l 0
[AR8-LoopBack0]ip add 11.1.1.1 24
[AR8-LoopBack0]int l 1
[AR8-LoopBack1]ip add 192.168.2.1 24
3、在AS 2启动OSPF
AR2
[AR2]ospf 1 router-id 2.2.2.2
[AR2-ospf-1]a 0
[AR2-ospf-1-area-0.0.0.0]network 172.16.0.2 0.0.0.0
[AR2-ospf-1-area-0.0.0.0]network 172.16.64.2 0.0.0.0
[AR2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
AR3
[AR3]ospf 1 router-id 3.3.3.3
[AR3-ospf-1]a 0
[AR3-ospf-1-area-0.0.0.0]network 172.16.0.3 0.0.0.0
[AR3-ospf-1-area-0.0.0.0]network 172.16.32.3 0.0.0.0[AR3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
AR4
[AR4]ospf 1 router-id 4.4.4.4
[AR4-ospf-1]a 0
[AR4-ospf-1-area-0.0.0.0]network 172.16.32.4 0.0.0.0[AR4-ospf-1-area-0.0.0.0]network 172.16.96.4 0.0.0.0
[AR4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
AR5
[AR5]ospf 1 router-id 5.5.5.5
[AR5-ospf-1]a 0
[AR5-ospf-1-area-0.0.0.0]network 172.16.64.5 0.0.0.0[AR5-ospf-1-area-0.0.0.0]network 172.16.128.5 0.0.0.0
[AR5-ospf-1-area-0.0.0.0]network 5.5.5.5 0.0.0.0
AR6
[AR6]ospf 1 router-id 6.6.6.6
[AR6-ospf-1]a 0
[AR6-ospf-1-area-0.0.0.0]network 172.16.128.6 0.0.0.0[AR6-ospf-1-area-0.0.0.0]network 172.16.160.6 0.0.0.0
[AR6-ospf-1-area-0.0.0.0]network 6.6.6.6 0.0.0.0
AR7
[AR7]ospf 1 router-id 7.7.7.7
[AR7-ospf-1]a 0
[AR7-ospf-1-area-0.0.0.0]network 172.16.160.7 0.0.0.0[AR7-ospf-1-area-0.0.0.0]network 172.16.96.7 0.0.0.0
[AR7-ospf-1-area-0.0.0.0]network 7.7.7.7 0.0.0.0
4、启动BGP协议
AR1
[AR1]bgp 1
[AR1-bgp]router-id 1.1.1.1
[AR1-bgp]peer 12.0.0.2 as 2
AR2
[AR2]bgp 64512
[AR2-bgp]router-id 2.2.2.2
[AR2-bgp]confederation id 2[AR2-bgp]peer 3.3.3.3 as 64512
[AR2-bgp]peer 3.3.3.3 con l 0
[AR2-bgp]peer 3.3.3.3 next-hop-local
[AR2-bgp]confederation peer-as 64513
[AR2-bgp]peer 5.5.5.5 as 64513
[AR2-bgp]peer 5.5.5.5 con l 0
[AR2-bgp]peer 5.5.5.5 ebgp-max-hop
[AR2-bgp]peer 5.5.5.5 next-hop-local
[AR2-bgp]peer 12.0.0.1 as 1
AR3
[AR3]bgp 64512
[AR3-bgp]router-id 3.3.3.3
[AR3-bgp]confederation id 2
[AR3-bgp]peer 2.2.2.2 as 64512
[AR3-bgp]peer 2.2.2.2 con l 0
[AR3-bgp]peer 2.2.2.2 reflect-client
[AR3-bgp]peer 4.4.4.4 as 64512
[AR3-bgp]peer 4.4.4.4 con l 0
[AR3-bgp]peer 4.4.4.4 reflect-client
AR4
[AR4]bgp 64512
[AR4-bgp]router-id 4.4.4.4
[AR4-bgp]confederation id 2
[AR4-bgp]peer 3.3.3.3 as 64512
[AR4-bgp]peer 3.3.3.3 con l 0
[AR4-bgp]confederation peer-as 64513
[AR4-bgp]peer 7.7.7.7 as 64513
[AR4-bgp]peer 7.7.7.7 con l 0
[AR4-bgp]peer 7.7.7.7 ebgp-max-hop
AR5
[AR5]bgp 64513
[AR5-bgp]router-id 5.5.5.5
[AR5-bgp]confederation id 2
[AR5-bgp]peer 6.6.6.6 as 64513
[AR5-bgp]peer 6.6.6.6 connect-interface l 0
[AR5-bgp]confederation peer-as 64512
[AR5-bgp]peer 2.2.2.2 as 64512
[AR5-bgp]peer 2.2.2.2 con l 0
[AR5-bgp]peer 2.2.2.2 ebgp-max-hop
AR6
[AR6]bgp 64513
[AR6-bgp]router-id 6.6.6.6
[AR6-bgp]confederation id 2
[AR6-bgp]peer 5.5.5.5 as 64513
[AR6-bgp]peer 5.5.5.5 con l 0
[AR6-bgp]peer 5.5.5.5 reflect-client
[AR6-bgp]peer 7.7.7.7 as 64513
[AR6-bgp]peer 7.7.7.7 con l 0
[AR6-bgp]peer 7.7.7.7 reflect-client
AR7
[AR7]bgp 64513
[AR7-bgp]router-id 7.7.7.7
[AR7-bgp]confederation id 2
[AR7-bgp]peer 6.6.6.6 as 64513
[AR7-bgp]peer 6.6.6.6 con l 0
[AR7-bgp]peer 6.6.6.6 next-hop-local
[AR7-bgp]confederation peer-as 64512
[AR7-bgp]peer 4.4.4.4 as 64512
[AR7-bgp]peer 4.4.4.4 con l 0[AR7-bgp]peer 4.4.4.4 next-hop-local
[AR7-bgp]peer 4.4.4.4 ebgp-max-hop[AR7-bgp]peer 78.0.0.8 as 3
AR8
[AR8]bgp 3
[AR8-bgp]router-id 8.8.8.8
[AR8-bgp]peer 78.0.0.7 as 2
5、宣告环回
AR1
[AR1]bgp 1
[AR1-bgp]network 10.1.1.0 24
AR2
[AR2]bgp 64512
[AR2-bgp]network 2.2.2.2 32
AR3
[AR3]bgp 64512
[AR3-bgp]network 3.3.3.3 32
AR4
[AR4]bgp 64512
[AR4-bgp]network 4.4.4.4 32
AR5
[AR5]bgp 64513
[AR5-bgp]network 5.5.5.5 32
AR6
[AR6]bgp 64513
[AR6-bgp]network 6.6.6.6 32
AR7
[AR7]bgp 64513
[AR7-bgp]network 7.7.7.7 32
AR8
[AR8]bgp 3
[AR8-bgp]network 11.1.1.0 24