分析问题
1、AS1存在两个环回,一个地址为192.168,1.0/24该地址不能在任何协议中宣告
AS3中存在两个环回,一个地址为192.168.2.8/24该地址不能在任何协议中宣告,最终要求这两个环回可以互相通讯AS1的另一个环回为10.0.0.0/24,AS3的另一个环回为11.0.0.0/24
只要完成BGP环境后进行路由发布就可以实现10.0.0.0/24和11.0.0.0/24的相互通信只要
建立一个虚拟隧道,并且配置一条指向对方网段的静态路由就可以实现在没有宣告的情况下达成192.168.1.0/24和192.168.2.0/24的相互通信
4、使用BGP协议让整个网络下的所有设备的环回可以相互通信
在AS2中配置ofps使网络互通,然后配置联邦和路由反射器来解决IBGP水平分割所导致的路由问题,最后还要发布在R1,R2,R7,R8上发布路由信息来完成路由的补全
5、减少路由条目数量,防止环路的发生
在AS之间进行路由聚合以此来减少路由条目
在设备上进行路由聚合操作会自动生成一条指向聚合网段的空接口,防止了环路的产生,也就达成了实验要求
IP划分
路由器配置
R1
sysname R1
#
interface GigabitEthernet0/0/0
ip address 12.0.0.1 255.255.255.0
#
interface LoopBack0
ip address 192.168.1.1 255.255.255.0
#
interface LoopBack1
ip address 10.0.0.1 255.255.255.0
#
interface Tunnel0/0/0
ip address 192.168.10.1 255.255.255.0
tunnel-protocol gre
source 12.0.0.1
destination 78.0.0.2
#
bgp 1
router-id 1.1.1.1
peer 12.0.0.2 as-number 2
#
ipv4-family unicast
undo synchronization
network 10.0.0.0 255.255.255.0
peer 12.0.0.2 enable
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 10.0.0.0 0.0.0.255
network 12.0.0.0 0.0.0.255
network 192.168.1.0 0.0.0.255
network 192.168.10.0 0.0.0.255
#
ip route-static 192.168.2.0 255.255.255.0 192.168.10.2
R2
sysname R2
#
interface GigabitEthernet0/0/0
ip address 12.0.0.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 172.16.32.1 255.255.240.0
#
interface GigabitEthernet0/0/2
ip address 172.16.16.1 255.255.240.0
#
interface LoopBack0
ip address 172.16.0.1 255.255.255.0
#
bgp 64512
router-id 2.2.2.2
confederation id 2
confederation peer-as 64513
peer 12.0.0.1 as-number 1
peer 172.16.1.1 as-number 64512
peer 172.16.1.1 connect-interface LoopBack0
peer 172.16.128.1 as-number 64513
peer 172.16.128.1 ebgp-max-hop 2
peer 172.16.128.1 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
aggregate 172.16.0.0 255.255.0.0 detail-suppressed
network 12.0.0.0 255.255.255.0
network 172.16.0.0 255.255.128.0
import-route ospf 1
peer 12.0.0.1 enable
peer 172.16.1.1 enable
peer 172.16.1.1 next-hop-local
peer 172.16.128.1 enable
peer 172.16.128.1 next-hop-local
#
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 172.16.0.0 0.0.0.255
network 172.16.16.0 0.0.15.255
network 172.16.32.0 0.0.15.255
#
ip route-static 172.16.128.0 255.255.255.0 172.16.16.2
R3
sysname R3
#
interface GigabitEthernet0/0/0
ip address 172.16.32.2 255.255.240.0
#
interface GigabitEthernet0/0/1
ip address 172.16.48.1 255.255.240.0
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 172.16.1.1 255.255.255.0
#
bgp 64512
peer 172.16.0.1 as-number 64512
peer 172.16.0.1 connect-interface LoopBack0
peer 172.16.2.1 as-number 64512
peer 172.16.2.1 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 172.16.0.1 enable
peer 172.16.0.1 reflect-client
peer 172.16.2.1 enable
#
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 172.16.1.0 0.0.0.255
network 172.16.32.0 0.0.15.255
network 172.16.48.0 0.0.15.255
R4
sysname R4
#
interface GigabitEthernet0/0/0
ip address 172.16.48.2 255.255.240.0
#
interface GigabitEthernet0/0/1
ip address 172.16.144.1 255.255.240.0
#
interface LoopBack0
ip address 172.16.2.1 255.255.255.0
#
bgp 64512
router-id 4.4.4.4
confederation id 2
confederation peer-as 64513
peer 172.16.1.1 as-number 64512
peer 172.16.1.1 connect-interface LoopBack0
peer 172.16.130.1 as-number 64513
peer 172.16.130.1 ebgp-max-hop 2
peer 172.16.130.1 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 172.16.1.1 enable
peer 172.16.130.1 enable
#
ospf 1 router-id 4.4.4.4
area 0.0.0.0
network 172.16.2.0 0.0.0.255
network 172.16.48.0 0.0.15.255
network 172.16.144.0 0.0.15.255
#
ip route-static 172.16.130.0 255.255.255.0 172.16.144.2
R5
sysname R5
#
interface GigabitEthernet0/0/0
ip address 172.16.16.2 255.255.240.0
#
interface GigabitEthernet0/0/1
ip address 172.16.176.1 255.255.240.0
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 172.16.128.1 255.255.255.0
#
bgp 64513
router-id 5.5.5.5
confederation id 2
confederation peer-as 64512
peer 172.16.0.1 as-number 64512
peer 172.16.0.1 ebgp-max-hop 2
peer 172.16.0.1 connect-interface LoopBack0
peer 172.16.129.1 as-number 64513
peer 172.16.129.1 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 172.16.0.1 enable
peer 172.16.129.1 enable
#
ospf 1 router-id 5.5.5.5
area 0.0.0.0
network 172.16.16.0 0.0.15.255
network 172.16.128.0 0.0.0.255
network 172.16.176.0 0.0.15.255
#
ip route-static 172.16.0.0 255.255.255.0 172.16.16.1
R6
sysname R6
#
interface GigabitEthernet0/0/0
ip address 172.16.160.1 255.255.240.0
#
interface GigabitEthernet0/0/1
ip address 172.16.176.2 255.255.240.0
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 172.16.129.1 255.255.255.0
#
bgp 64513
router-id 6.6.6.6
peer 172.16.128.1 as-number 64513
peer 172.16.128.1 connect-interface LoopBack0
peer 172.16.130.1 as-number 64513
peer 172.16.130.1 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 172.16.128.1 enable
peer 172.16.130.1 enable
peer 172.16.130.1 reflect-client
#
ospf 1 router-id 6.6.6.6
area 0.0.0.0
network 172.16.129.0 0.0.0.255
network 172.16.160.0 0.0.15.255
network 172.16.176.0 0.0.15.255
R7
sysname R7
#
interface GigabitEthernet0/0/0
ip address 172.16.144.2 255.255.240.0
#
interface GigabitEthernet0/0/1
ip address 172.16.160.2 255.255.240.0
#
interface GigabitEthernet0/0/2
ip address 78.0.0.1 255.255.255.0
#
interface LoopBack0
ip address 172.16.130.1 255.255.255.0
#
bgp 64513
router-id 7.7.7.7
confederation id 2
confederation peer-as 64512
peer 78.0.0.2 as-number 3
peer 172.16.2.1 as-number 64512
peer 172.16.2.1 ebgp-max-hop 2
peer 172.16.2.1 connect-interface LoopBack0
peer 172.16.129.1 as-number 64513
peer 172.16.129.1 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
aggregate 172.16.0.0 255.255.0.0 detail-suppressed
network 78.0.0.0 255.255.255.0
import-route ospf 1
peer 78.0.0.2 enable
peer 172.16.2.1 enable
peer 172.16.2.1 next-hop-local
peer 172.16.129.1 enable
peer 172.16.129.1 next-hop-local
#
ospf 1 router-id 7.7.7.7
area 0.0.0.0
network 172.16.130.0 0.0.0.255
network 172.16.144.0 0.0.15.255
network 172.16.160.0 0.0.15.255
#
ip route-static 172.16.2.0 255.255.255.0 172.16.144.1
R8
sysname R8
#
interface GigabitEthernet0/0/0
ip address 78.0.0.2 255.255.255.0
#
interface LoopBack0
ip address 192.168.2.1 255.255.255.0
#
interface LoopBack1
ip address 11.0.0.1 255.255.255.0
#
interface Tunnel0/0/0
ip address 192.168.10.2 255.255.255.0
tunnel-protocol gre
source 78.0.0.2
destination 12.0.0.1
#
bgp 3
router-id 8.8.8.8
peer 78.0.0.1 as-number 2
#
ipv4-family unicast
undo synchronization
network 11.0.0.0 255.255.255.0
peer 78.0.0.1 enable
#
ospf 1 router-id 8.8.8.8
#
ip route-static 192.168.1.0 255.255.255.0 192.168.10.1
成果演示
1、192.168.1.0/24和192.168.2.0/24的相互通信
2、访问环回
3、聚合和防环
R2
R7