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,减少路由条目数量,避免环路出现
设备 | 接口 | 地址 |
---|---|---|
R1 | G0/0/0 | 12.1.1.1/24 |
LoopBack0 | 192.168.1.1/24 | |
LoopBack1 | 10.1.1.0/24 | |
R8 | G0/0/0 | 78.1.1.1/24 |
LoopBack0 | 192.168.2.1/24 | |
LoopBack1 | 11.1.1.0/24 |
R1:
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 192.168.1.1 24
[R1]interface LoopBack 1
[R1-LoopBack1]ip address 10.1.1.1 24
R2:
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[R2-GigabitEthernet0/0/0]q
[R2]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip address 172.16.1.1 29
[R2-GigabitEthernet0/0/1]q
[R2]interface g0/0/2
[R2-GigabitEthernet0/0/2]ip address 172.16.1.9 29
[R2-GigabitEthernet0/0/2]q
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 172.16.2.1 24
R3:
[R3]interface g0/0/0
[R3-GigabitEthernet0/0/0]ip address 172.16.1.2 29
[R3-GigabitEthernet0/0/0]q
[R3]interface g0/0/1
[R3-GigabitEthernet0/0/1]ip address 172.16.1.25 29
[R3-GigabitEthernet0/0/1]q
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 172.16.3.1 24
R4:
[R4]interface g0/0/1
[R4-GigabitEthernet0/0/1]ip address 172.16.1.33 29
[R4-GigabitEthernet0/0/1]q
[R4]interface g0/0/0
[R4-GigabitEthernet0/0/0]ip address 172.16.1.26 29
[R4-GigabitEthernet0/0/0]q
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 172.16.4.1 24
R5:
[R5]interface g0/0/0
[R5-GigabitEthernet0/0/0]ip ad
[R5-GigabitEthernet0/0/0]ip address 172.16.1.10 29
[R5]interface g0/0/1
[R5-GigabitEthernet0/0/1]ip address 172.16.1.41 29
[R5-GigabitEthernet0/0/1]q
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 172.16.5.1 24
R6:
[R6]interface g0/0/0
[R6-GigabitEthernet0/0/0]ip address 172.16.1.42 29
[R6-GigabitEthernet0/0/0]q
[R6]interface g0/0/1
[R6-GigabitEthernet0/0/1]ip address 172.16.1.49 29
[R6-GigabitEthernet0/0/1]q
[R6]interface LoopBack 0
[R6-LoopBack0]ip address 172.16.6.1 24
R7:
[R7]interface g0/0/0
[R7-GigabitEthernet0/0/0]ip address 172.16.1.50 29
[R7-GigabitEthernet0/0/0]q
[R7]interface g0/0/1
[R7-GigabitEthernet0/0/1]ip address 172.16.1.34 29
[R7-GigabitEthernet0/0/1]q
[R7]interface LoopBack 0
[R7-LoopBack0]ip address 172.16.7.1 24
[R7-LoopBack0]q
[R7]interface g0/0/2
[R7-GigabitEthernet0/0/2]ip address 78.1.1.2 24
R8:
[R8]interface g0/0/0
[R8-GigabitEthernet0/0/0]ip address 78.1.1.1 24
[R8-GigabitEthernet0/0/0]q
[R8]interface LoopBack 0
[R8-LoopBack0]ip address 192.168.2.1 24
[R8-LoopBack0]q
[R8]interface LoopBack 1
[R8-LoopBack1]ip address 11.1.1.1 24
R2:
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.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.255.255
R4:
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
R5:
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
R6:
[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1]area 0
[R6-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
R7:
[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]area 0
[R7-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
R1:
[R1]bgp 1
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 12.1.1.2 as-number 2
R2:
[R2]bgp 64512
[R2-bgp]router-id 2.2.2.2
[R2-bgp]confederation id 2 //声明大号为AS2
[R2-bgp]confederation peer-as 64513 //与小号64513建邻
[R2-bgp]peer 12.1.1.1 as-number 1 //与AS1建邻
[R2-bgp]peer 172.16.3.1 as-number 64512
[R2-bgp]peer 172.16.3.1 connect-interface LoopBack 0
[R2-bgp]peer 172.16.5.1 as-number 64513
[R2-bgp]peer 172.16.5.1 connect-interface LoopBack 0
[R2-bgp]peer 172.16.5.1 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.2.1 as-number 64512
[R3-bgp]peer 172.16.2.1 connect-interface LoopBack 0
[R3-bgp]peer 172.16.4.1 as-number 64512
[R3-bgp]peer 172.16.4.1 connect-interface LoopBack 0
R4:
[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-number 64513
[R4-bgp]peer 172.16.7.1 connect-interface LoopBack 0
[R4-bgp]peer 172.16.7.1 ebgp-max-hop
R5:
[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-number 64512
[R5-bgp]peer 172.16.2.1 connect-interface LoopBack 0
[R5-bgp]peer 172.16.2.1 ebgp-max-hop
[R5-bgp]peer 172.16.6.1 as-number 64513
[R5-bgp]peer 172.16.6.1 connect-interface LoopBack 0
R6:
[R6]bgp 64513
[R6-bgp]router-id 6.6.6.6
[R6-bgp]confederation id 2
[R6-bgp]peer 172.16.5.1 as-number 64513
[R6-bgp]peer 172.16.5.1 connect-interface LoopBack 0
[R6-bgp]peer 172.16.7.1 as-number 64513
[R6-bgp]peer 172.16.7.1 connect-interface LoopBack 0
R7:
[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-number 64513
[R7-bgp]peer 172.16.6.1 connect-interface LoopBack 0
[R7-bgp]peer 172.16.4.1 as-number 64512
[R7-bgp]peer 172.16.4.1 connect-interface LoopBack 0
[R7-bgp]peer 172.16.4.1 ebgp-max-hop
[R7-bgp]peer 78.1.1.1 as 3
R8:
[R8]bgp 3
[R8-bgp]router-id 8.8.8.8
[R8-bgp]peer 78.1.1.2 as-number 2
R1:
[R1]bgp 1
[R1-bgp]network 10.1.1.0 24
注意:通告后只有R2收到该路由,R3、R5未收到,因为在BGP路由表中的下一跳没有改变,永远是R1的下一跳,所以要在R2上把下一跳改到本地路由中
[R2]bgp 64512
[R2-bgp]peer 172.16.3.1 next-hop-local
[R2-bgp]peer 172.16.5.1 next-hop-local
R3:
[R3]bgp 64512
[R3-bgp]peer 172.16.2.1 reflect-client
R6:
[R6]bgp 64513
[R6-bgp]peer 172.16.5.1 reflect-client
R8:
[R8]bgp 3
[R8-bgp]network 11.1.1.0 24
同理:通告后只有R7收到该路由,其他未收到,因为在BGP路由表中的下一跳没有改变,永远是R8的下一跳,所以要在R7上把下一跳改到本地路由中
[R7]bgp 64513
[R7-bgp]peer 172.16.6.1 next-hop-local
[R7-bgp]peer 172.16.4.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
R1:
[R1]int t0/0/0
[R1-Tunnel0/0/0]ip address 100.1.1.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre
[R1-Tunnel0/0/0]source 10.1.1.1
[R1-Tunnel0/0/0]destination 11.1.1.1
R8:
[R8]interface Tunnel 0/0/0
[R8-Tunnel0/0/0]ip address 100.1.1.2 24
[R8-Tunnel0/0/0]tunnel-protocol gre
[R8-Tunnel0/0/0]source 11.1.1.1
[R8-Tunnel0/0/0]destination 10.1.1.1
![在这里插入图片描述](https://img-blog.csdnimg.cn/0eb16f1a9ddf459e8f08c204215ce69c.png