一.实验图及要求
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
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
三.ping
1、192.168.1.0/24和192.168.2.0/24的相互通信
2、访问环回