拓扑图
要求
1.AS1存在两个环回,一个地址为192.168.1.0/24该地址不能在任何协议中宣告
AS3中存在两个环回,一个地址为192.168.2.0/24该地址不能在任何协议中宣告,
最终要求这两个环回可以互相通讯
2.整个AS2的Ip地址为172.16.0.0/16,请合理划分
3.AS间的骨干链路Ip地址随意定制
4.使用BGP协议让整个网络所有设备的环回可以互相访问5,减少路由条目数量,避免环路出现
配置IP
配置边界静态
[r2]ip route-static 1.1.1.1 32 12.1.1.1
[r1]ip route-static 172.16.0.2 32 12.1.1.2
`[r7]ip route-static 8.8.8.8 32 78.1.1.8
[r7]ping 8.8.8.8
PING 8.8.8.8: 56 data bytes, press CTRL_C to break
Reply from 8.8.8.8: bytes=56 Sequence=1 ttl=255 time=90 ms
Reply from 8.8.8.8: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 8.8.8.8: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 8.8.8.8: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 8.8.8.8: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 8.8.8.8 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/38/90 ms
R2-R7进行宣告
[r6]ospf 1
[r6-ospf-1]area 0
[r6-ospf-1-area-0.0.0.0]n
[r6-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
[r6-LoopBack1]ospf network-type broadcast
R1启动BGP
[r1]bgp 1
[r1-bgp]router-id 1.1.1.1
[r1-bgp]peer 172.16.0.2 as-number 2
[r1-bgp]peer 172.16.0.2 connect-interface LoopBack 0
[r1-bgp]peer 172.16.0.2 ebgp-max-hop 2
[r2]bgp 64512
[r2-bgp]confederation id 2
[r2-bgp]router-id 172.16.0.2
[r2-bgp]peer 1.1.1.1 as-number 1
[r2-bgp]peer 1.1.1.1 connect-interface LoopBack 0
[r2-bgp]peer 1.1.1.1 ebgp-max-hop 2
[r2]bgp 64512
[r2-bgp]peer 172.16.0.3 as-number 64512
[r2-bgp]peer 172.16.0.3 connect-interface LoopBack 0
[r2-bgp]peer 172.16.0.3 next-hop-local
[r2]bgp 64512
[r2-bgp]confederation peer-as 64513
[r2-bgp]peer 172.16.0.5 as-number 64513
[r2-bgp]peer 172.16.0.5 connect-interface LoopBack 0
[r2-bgp]peer 172.16.0.5 ebgp-max-hop 2
[r3]bgp 64512
[r3-bgp]confederation id 2
[r3-bgp]peer 172.16.0.2 as-number 64512
[r3-bgp]peer 172.16.0.2 connect-interface LoopBack 0
[r3-bgp]peer
Jan 8 2023 22:02:53-08:00 r3 %%01BGP/3/STATE_CHG_UPDOWN(l)[0]:The status of the
peer 172.16.0.2 changed from OPENCONFIRM to ESTABLISHED. (InstanceName=Public,
StateChangeReason=Up)
[r3-bgp]peer 172.16.0.4 as-number 64512
[r3-bgp]peer 172.16.0.4 connect-interface LoopBack 0
[r3-bgp]peer 172.16.0.4 next-hop-local