1.拓扑图
2.要求
1.AS1存在两个环回,一个地址为192.168.1.0/24,该地址不能在任何协议中宣告
AS8中存在两个环回,一个为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.减少路由条目数量,避免环路产生
3.子网划分
首先,根据实验要求,将172.16.0.0/16全部划分为掩码为24的子网
172.16.0.0/24
172.16.1.0/24
172.16.2.0/24
172.16.3.0/24
172.16.4.0/24
172.16.5.0/24
172.16.6.0/24
172.16.7.0/24
172.168.1.0 29
172.168.1.8 29
172.168.1.16 29
172.168.1.32 29
172.168.1.40 29
172.168.1.48 29
4.配置IP
以R1和R2为例
[R1]int l0
[R1-LoopBack0]ip add 192.168.1.1 24
[R1-LoopBack0]int l1
[R1-LoopBack1]ip add 10.0.00.1 24
[R1-LoopBack1]q
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 12.0.0.1 24
[R2]int l0
[R2-LoopBack0]ip add 172.168.2.1 24
[R2-LoopBack0]q
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[R2-GigabitEthernet0/0/0]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 29
5..基本配置
配置ospf,以r2为例
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]a 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.0.0 0.0.255.255
配置bgp,以r1,r2,r5为例,由于r2,r5处于联邦内,故启用BGP的私有AS号
[R1]bgp 1
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 12.0.0.2 as-number 2
[R2]bgp 64512
[R2-bgp]rou
[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 l0
[R2-bgp]peer 172.16.5.1 as 64513
[R2-bgp]peer 172.16.5.1 connect-interface l0
[R2-bgp]peer 172.16.5.1 ebgp-max-hop
[R5]bgp 64513
[R5-bgp]rou
[R5-bgp]route-select
[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 l0
[R5-bgp]peer 172.16.6.1 as 64513
[R5-bgp]peer 172.16.6.1 connect-interface l0
[R5-bgp]peer 172.16.2.1 ebgp-max-hop
[R1-bgp]network 10.0.0.0 24
[R2-bgp]peer 172.16.3.1 next-hop-local
[R2-bgp]peer 172.16.5.1 next-hop-local
[R3-bgp]peer 172.16.2.1 reflect-client
[R6-bgp]peer 172.16.7.1 reflect-client
[R8-bgp]network 11.0.0.0 24
[R7-bgp]peer 172.16.4.1 next-hop-local
[R7-bgp]peer 172.16.6.1 next-hop-local
[R2]ip route-static 172.16.0.0 21 null 0
[R2]bgp 64512
[R2-bgp]network 172.16.0.0 21
[R7]ip route-static 172.16.0.0 21 null 0
[R7-bgp]network 172.16.0.0 21
[R1]interface Tunnel 0/0/0
[R1-Tunnel0/0/0]ip add 100.0.0.1 24
[R1-Tunnel0/0/0]tunnel-protocol g
[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
[R8]int t0/00/0
[R8-Tunnel0/0/0]ip add 100.0.0.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
[R1]ip route-static 192.168.2.0 24 100.0.0.2
[R8]ip route-static 192.168.1.0 24 100.0.0.1
测试