实验要求:
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,减少路由条目数量,避免环路出现
实验拓扑
实验步骤:
1、网段划分
AS2网段划分
主干链路:
172.16.0.0/19
各链路网段划分
172.16.0.0/30
172.16.0.32/30
172.16.0.64/30
172.16.0.96/30
172.16.0.128/30
172.16.0.160/30
各路由器环回地址
172.16.32.0/19 >> 172.16.32.0/24
172.16.64.0/19 >> 172.16.64.0/24
172.16.96.0/19 >> 172.16.96.0/24
172.16.128.0/19 >> 172.16.128.0/24
172.16.160.0/19 >> 172.16.160.0/24
172.16.192.0/19 >> 172.16.192.0/24
2、各路由器ip配置
R1:
ip address 12.0.0.1 24
ip address 192.168.2.1 24
ip address 10.0.0.1 24
R2:
ip address 12.0.0.2 24
ip address 172.16.0.1 30
ip address 172.16.0.162 30
ip address 172.16.32.1 24
R3:
ip address 172.16.0.2 30
ip address 172.16.0.33 30
ip address 172.16.64.1 24
R4:
ip address 172.16.0.34 30
ip address 172.16.0.65 30
ip address 172.16.96.1 24
R7:
ip address 172.16.0.66 30
ip address 172.16.0.97 30
ip address 172.16.128.1 24
ip address 78.0.0.1 24
R6:
ip address 172.16.0.98 30
ip address 172.16.0.129 30
ip address 172.16.160.1 24
R5:
ip address 172.16.0.130 30
ip address 172.16.0.161 30
ip address 172.16.192.1 24
R8:
ip address 78.0.0.2 24
ip address 192.168.2.1 24
ip address 11.0.0.1 24
3、配置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 172.16.0.0 0.0.0.255
R3:
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.0.255
其他设备相同
4、配置BGP
R1:
[R1]bgp 1
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 12.0.0.2 as-number 2
R2:
[R2]bgp 64512
[R2-bgp]confederation id 2
[R2-bgp]router-id 2.2.2.2
[R2-bgp]peer 12.0.0.1 as-number 1
[R2-bgp]confederation peer-as 64513
[R2-bgp]peer 172.16.0.2 as-number 64512
[R2-bgp]peer 172.16.0.2 connect-interface LoopBack 0
[R2-bgp]peer 172.16.0.161 as-number 64513
[R2-bgp]peer 172.16.0.161 connect-interface LoopBack 0
[R2-bgp]peer 172.16.0.161 ebgp-max-hop
R3:
[R3]bgp 64512
[R3-bgp]router-id 3.3.3.3
[R3-bgp]confederation id 2
[R3-bgp]peer 172.16.0.1 as-number 64512
[R3-bgp]peer 172.16.0.1 connect-interface LoopBack 0
[R3-bgp]peer 172.16.0.34 as-number 64512
[R3-bgp]peer 172.16.0.34 connect-interface LoopBack 0
R4:
[R4]bgp 64512
[R4-bgp]confederation id 2
[R4-bgp]router-id 4.4.4.4
[R1-bgp]peer 12.0.0.33 as-number 1
[R4-bgp]confederation peer-as 64513
[R4-bgp]peer 172.16.0.33 as-number 64512
[R4-bgp]peer 172.16.0.33 connect-interface LoopBack 0
[R4-bgp]peer 172.16.0.66as-number 64513
[R4-bgp]peer 172.16.0.66 connect-interface LoopBack 0
[R4-bgp]peer 172.16.0.66 ebgp-max-hop
R7:
[R7]bgp 64513
[R7-bgp]confederation id 2
[R7-bgp]router-id 7.7.7.7
[R7-bgp]peer 78.0.0.2 as-number 3
[R7-bgp]confederation peer-as 64513
[R7-bgp]peer 172.16.0.65 as-number 64512
[R7-bgp]peer 172.16.0.65 connect-interface LoopBack 0
[R7-bgp]peer 172.16.0.65 ebgp-max-hop
[R7-bgp]peer 172.16.0.98 as-number 64513
[R7-bgp]peer 172.16.0.98 connect-interface LoopBack 0
[R7-bgp]peer 172.16.0.98 ebgp-max-hop
R6:
[R6]bgp 64513
[R6-bgp]router-id 6.6.6.6
[R6-bgp]confederation id 2
[R6-bgp]peer 172.16.0.97 as-number 64513
[R6-bgp]peer 172.16.0.97 connect-interface LoopBack 0
[R6-bgp]peer 172.16.0.130 as-number 64513
[R6-bgp]peer 172.16.0.130 connect-interface LoopBack 0
R5:
[R5]bgp 64513
[R5-bgp]router-id 5.5.5.5
[R5-bgp]confederation id 2
[R5-bgp]peer 172.16.0.139 as-number 64513
[R5-bgp]peer 172.16.0.139 connect-interface LoopBack 0
[R5-bgp]peer 172.16.0.1 as-number 64512
[R5-bgp]peer 172.16.0.1 connect-interface LoopBack 0
[R2-bgp]peer 172.16.0.161 ebgp-max-hop
R8:
[R5]bgp 3
[R5-bgp]router-id 8.8.8.8
[R5-bgp]peer 78.0.0.1 as-number 2
5、发布路由
发布R1路由
[R1-bgp]network 10.0.0.0 24
[R1-bgp]display bgp peer
发布R8路由
[R8]bgp 3
[R8-bgp]network 11.0.0.0 24
发布R2汇总路由
[R2]bgp 64512
[R2-bgp]network 172.16.0.0 21
解决下一跳问题
[R2]bgp 64512
[R2-bgp]peer 172.16.0.2 next-hop-local
[R2-bgp]peer 172.16.0.161 next-hop-local
6、配置反射器并配置空接口
[R3]bgp
[R3]bgp 64512
[R3-bgp]peer 172.16.0.1 reflect-client
[R6]bgp 64513
[R6-bgp]peer 172.16.0.97 reflect-client
[R2]ip route-static 172.16.0.0 21 NULL 0
[R2]display ip routing-table protocol static
7、配置GRE环境
[R1-Tunnel0/0/0]ip address 15.0.0.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
[R8]int t 0/0/0
[R8-Tunnel0/0/0]ip address 15.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 15.0.0.2
[R8]ip route-static 192.168.1.0 24 15.0.0.1
进行测试: