1、试验要求及拓扑图
拓扑图:
要求:
1,R4为ISP,其上只能配置IP地址;R4与其他所有直连设备间均使用公有IP
2,R3-R5/6/7为MGRE环境,R3为中心站点;
3,整个OSPF环境IP基于172.16.0.0/16划分;
4,所有设备均可访问R4的环回;
5,减少LSA的更新量,加快收敛,保障更新安全;
6,全网可达
2、配置
为R4与其他设备的连接分配公网IP地址:
- R4到AR3: 192.0.2.1 255.255.255.252
- R4到AR5: 192.0.2.5 255.255.255.252
- R4到AR6: 192.0.2.9 255.255.255.252
- R4到AR7: 192.0.2.13 255.255.255.252
R4 (ISP)配置
interface Serial 4/0/0
ip address 192.0.2.1 255.255.255.252
# 配置与R3的接口地址
interface Serial 4/0/1
ip address 192.0.2.5 255.255.255.252
# 配置与R5的接口地址
interface Serial 3/0/0
ip address 192.0.2.9 255.255.255.252
# 配置与R6的接口地址
interface GigabitEthernet 0/0/0
ip address 192.0.2.13 255.255.255.252
# 配置与R7的接口地址
interface Loopback 0
ip address 172.16.255.1 255.255.255.255
# 配置环回接口地址
ospf 1
area 0
network 192.0.2.0 0.0.0.3
network 192.0.2.4 0.0.0.3
network 192.0.2.8 0.0.0.3
network 192.0.2.12 0.0.0.3
network 172.16.255.1 0.0.0.0
# 在OSPF区域0中配置各网段和环回接口
R3配置
interface GigabitEthernet 0/0/0
ip address 172.16.0.1 255.255.255.252
# 配置与LSW1的接口地址
interface Serial 4/0/0
ip address 192.0.2.2 255.255.255.252
# 配置与R4的接口地址
interface Tunnel 0/0/0
ip address 172.16.100.1 255.255.255.0
tunnel-protocol gre
source Serial 4/0/0
# 配置GRE隧道接口,作为MGRE的中心节点
ospf 1
area 0
network 192.0.2.0 0.0.0.3
network 172.16.100.0 0.0.0.255
area 1
network 172.16.1.12 0.0.0.3
# 在OSPF区域0中配置各网段
R5配置:
interface Serial 4/0/0
ip address 192.0.2.6 255.255.255.252
quit
# 配置与R4的接口地址
interface Tunnel 0/0/0
ip address 172.16.100.2 255.255.255.0
tunnel-protocol gre
source Serial 4/0/0
destination 172.16.100.1
# 配置GRE隧道接口,终点为R3的GRE地址
ospf 1
area 0
network 192.0.2.4 0.0.0.3
network 172.16.100.0 0.0.0.255
# 在OSPF区域0中配置各网段
R6配置
interface Serial 4/0/0
ip address 192.0.2.10 255.255.255.252
# 配置与R4的接口地址
interface GigabitEthernet 0/0/0
ip address 172.16.2.2 255.255.255.252
# 配置与R11的接口地址
interface Tunnel 0/0/0
ip address 172.16.100.3 255.255.255.0
tunnel-protocol gre
source Serial 4/0/0
destination 172.16.100.1
# 配置GRE隧道接口,终点为R3的GRE地址
ospf 1
area 0
network 172.16.100.0 0.0.0.255
network 192.0.2.8 0.0.0.3
area 2
network 172.16.2.0 0.0.0.3
# 在OSPF区域0中配置各网段
R7 配置
interface GigabitEthernet 0/0/0
ip address 192.0.2.14 255.255.255.252
# 配置与R4的接口地址
interface GigabitEthernet 0/0/1
ip address 172.16.3.1 255.255.255.252
# 配置与AR8的接口地址
interface Tunnel 0/0/0
ip address 172.16.100.4 255.255.255.0
tunnel-protocol gre
source GigabitEthernet 0/0/0
destination 172.16.100.1
# 配置GRE隧道接口,终点为R3的GRE地址
ospf 1
area 0
network 192.0.2.12 0.0.0.3
network 172.16.100.0 0.0.0.255
area 3
network 172.16.3.0 0.0.0.3
# 在OSPF区域0中配置GRE网段,在区域3中配置与AR8的网段
R8配置
interface GigabitEthernet 0/0/0
ip address 172.16.3.5 255.255.255.252
# 配置与R7的接口地址
interface GigabitEthernet 0/0/1
ip address 172.16.3.9 255.255.255.252
# 配置与AR9的接口地址
ospf 1
area 3
network 172.16.3.4 0.0.0.3
network 172.16.3.8 0.0.0.3
# 在OSPF区域3中配置各网段
R9配置:
interface GigabitEthernet 0/0/0
ip address 172.16.4.1 255.255.255.252
# 配置与AR8的接口地址
interface GigabitEthernet 0/0/1
ip address 172.16.4.5 255.255.255.252
# 配置与AR10的接口地址
ospf 1
area 3
network 172.16.3.12 0.0.0.3
area 4
network 172.16.4.0 0.0.0.3
# 在OSPF区域4中配置各网段
R10配置
interface GigabitEthernet 0/0/0
ip address 172.16.4.9 255.255.255.252
# 配置与AR9的接口地址
ospf 1
area 4
network 172.16.4.4 0.0.0.3
# 在OSPF区域4中配置网段
R1配置
interface GigabitEthernet 0/0/0
ip address 172.16.1.1 255.255.255.252
# 配置与LSW1的接口地址
interface GigabitEthernet 0/0/1
ip address 172.16.1.5 255.255.255.252
# 配置与AR2的接口地址
ospf 1
area 1
network 172.16.1.0 0.0.0.3
# 在OSPF区域1中配置各网段
R2配置
interface GigabitEthernet 0/0/0
ip address 172.16.1.9 255.255.255.252
# 配置与LSW1的接口地址
ospf 1
area 1
network 172.16.1.8 0.0.0.3
# 在OSPF区域1中配置网段
R11配置
interface GigabitEthernet 0/0/0
ip address 172.16.2.1 255.255.255.252
# 配置与R6的接口地址
interface GigabitEthernet 0/0/1
ip address 172.16.2.5 255.255.255.252
# 配置与AR12的接口地址
ospf 1
area 2
network 172.16.2.4 0.0.0.3
network 172.16.2.8 0.0.0.3
# 在OSPF区域2中配置各网段
R12配置
interface GigabitEthernet 0/0/0
ip address 172.16.2.9 255.255.255.252
# 配置与R11的接口地址
ospf 1
area 2
network 172.16.2.12 0.0.0.3
# 在OSPF区域2中配置网段
LSW1配置
interface GigabitEthernet 0/0/1
undo shutdown
# 启用接口,连接R1
interface GigabitEthernet 0/0/2
undo shutdown
# 启用接口,连接R2
interface GigabitEthernet 0/0/3
undo shutdown
# 启用接口,连接R3
3.检验
ping通测试