1. R5为ISP,其上只能配置IP地址;R5与其他所有直连设备间均使用公有IP;环回地址为100.1.1.1/32
2. R4设备为企业出口路由器
3. 整个OSPF环境IP基于172.16.0.0/16划分;
4. 所有设备均可访问R5的环回;
5. 减少LSA的更新量,加快收敛,保障更新安全;
6. 全网可达
R1
# 基础配置
sysname R1
interface GigabitEthernet0/0/0
ip address 172.16.1.1 255.255.255.252 # area1内与LSW1相连链路IP
interface GigabitEthernet0/0/2
ip address 172.16.1.5 255.255.255.252 # area1内与R2相连链路IP
interface LoopBack0
ip address 172.16.1.9 255.255.255.255 # 环回地址
# OSPF配置
ospf 1 router - id 1.1.1.1
area 1
network 172.16.1.0 0.0.0.3
network 172.16.1.4 0.0.0.3
network 172.16.1.8 0.0.0.0
R2
sysname R2
interface GigabitEthernet0/0/0
ip address 172.16.1.6 255.255.255.252 # area1内与R1相连链路IP
interface GigabitEthernet0/0/1
ip address 172.16.1.10 255.255.255.252 # area1内与LSW1相连链路IP
interface LoopBack0
ip address 172.16.1.13 255.255.255.255 # 环回地址
ospf 1 router - id 2.2.2.2
area 1
network 172.16.1.4 0.0.0.3
network 172.16.1.8 0.0.0.3
network 172.16.1.12 0.0.0.0
LSW1
sysname LSW1
vlan batch 10 20 # 根据需求划分VLAN
interface GigabitEthernet0/0/1
port link - type trunk
port trunk allow - pass vlan 10 20
interface GigabitEthernet0/0/2
port link - type access
port default vlan 10
interface GigabitEthernet0/0/3
port link - type access
port default vlan 20
R3
sysname R3
interface GigabitEthernet0/0/0
ip address 172.16.1.11 255.255.255.252 # area1内与LSW1相连链路IP
interface Serial4/0/0
ip address 172.16.2.1 255.255.255.252 # area0内与R4相连链路IP
interface LoopBack0
ip address 172.16.2.9 255.255.255.255 # 环回地址
ospf 1 router - id 3.3.3.3
area 1
network 172.16.1.8 0.0.0.3
network 172.16.1.12 0.0.0.0
area 0
network 172.16.2.0 0.0.0.3
network 172.16.2.8 0.0.0.0
R4(企业出口路由器)
sysname R4
interface Serial4/0/0
ip address 172.16.2.2 255.255.255.252 # area0内与R3相连链路IP
interface Serial4/0/1
ip address 203.0.113.2 255.255.255.252 # 与R5相连接口的公有IP
interface Serial3/0/0
ip address 172.16.2.13 255.255.255.252 # area0内与R6相连链路IP
interface GigabitEthernet0/0/0
ip address 172.16.2.17 255.255.255.252 # area0内与R7相连链路IP
interface LoopBack0
ip address 172.16.2.21 255.255.255.255 # 环回地址
# OSPF配置
ospf 1 router - id 4.4.4.4
area 0
authentication - mode md5 1 cipher huawei # 配置 OSPF 认证
network 172.16.2.0 0.0.0.3
network 172.16.2.4 0.0.0.3
network 172.16.2.12 0.0.0.3
network 172.16.2.16 0.0.0.3
network 172.16.2.20 0.0.0.0
# 配置默认路由指向 R5
ip route - static 0.0.0.0 0.0.0.0 203.0.113.1
R5(ISP路由器)
sysname R5
interface Serial4/0/0
ip address 203.0.113.1 255.255.255.252 # 与R4相连接口的公有IP
interface Serial4/0/1
ip address 203.0.113.5 255.255.255.252 # 与其他直连设备相连接口的公有IP
interface LoopBack0
ip address 100.1.1.1 255.255.255.255 # 环回地址
R6
sysname R6
interface Serial3/0/0
ip address 172.16.2.14 255.255.255.252 # area0内与R4相连链路IP
interface GigabitEthernet0/0/0
ip address 172.16.3.1 255.255.255.252 # area2内与R11相连链路IP
interface LoopBack0
ip address 172.16.3.9 255.255.255.255 # 环回地址
ospf 1 router - id 6.6.6.6
area 0
authentication - mode md5 1 cipher huawei # 配置 OSPF 认证
network 172.16.2.12 0.0.0.3
network 172.16.2.16 0.0.0.0
area 2
network 172.16.3.0 0.0.0.3
network 172.16.3.8 0.0.0.0
R7
sysname R7
interface GigabitEthernet0/0/0
ip address 172.16.2.18 255.255.255.252 # area0内与R4相连链路IP
interface GigabitEthernet0/0/1
ip address 172.16.4.1 255.255.255.252 # area3内与R8相连链路IP
interface LoopBack0
ip address 172.16.4.9 255.255.255.255 # 环回地址
ospf 1 router - id 7.7.7.7
area 0
authentication - mode md5 1 cipher huawei # 配置 OSPF 认证
network 172.16.2.16 0.0.0.3
network 172.16.2.20 0.0.0.0
area 3
network 172.16.4.0 0.0.0.3
network 172.16.4.8 0.0.0.0
R8
sysname R8
interface GigabitEthernet0/0/0
ip address 172.16.4.2 255.255.255.252 # area3内与R7相连链路IP
interface GigabitEthernet0/0/1
ip address 172.16.4.5 255.255.255.252 # area3内与R9相连链路IP
interface LoopBack0
ip address 172.16.4.13 255.255.255.255 # 环回地址
ospf 1 router - id 8.8.8.8
area 3
network 172.16.4.0 0.0.0.3
network 172.16.4.4 0.0.0.3
network 172.16.4.12 0.0.0.0
R9
sysname R9
interface GigabitEthernet0/0/0
ip address 172.16.4.6 255.255.255.252 # area3内与R8相连链路IP
interface GigabitEthernet0/0/1
ip address 172.16.5.1 255.255.255.252 # area4内与R10相连链路IP
interface LoopBack0
ip address 172.16.5.9 255.255.255.255 # 环回地址
ospf 1 router - id 9.9.9.9
area 3
network 172.16.4.4 0.0.0.3
network 172.16.4.12 0.0.0.0
area 4
network 172.16.5.0 0.0.0.3
network 172.16.5.8 0.0.0.0
R10
sysname R10
interface GigabitEthernet0/0/0
ip address 172.16.5.2 255.255.255.252 # area4内与R9相连链路IP
interface LoopBack0
ip address 172.16.5.13 255.255.255.255 # 环回地址
ospf 1 router - id 10.10.10.10
area 4
network 172.16.5.0 0.0.0.3
network 172.16.5.4 0.0.0.3
network 172.16.5.12 0.0.0.0
R11
sysname R11
interface GigabitEthernet0/0/0
ip address 172.16.3.2 255.255.255.252 # area2内与R6相连链路IP
interface GigabitEthernet0/0/1
ip address 172.16.3.5 255.255.255.252 # area2内与R12相连链路IP
interface LoopBack0
ip address 172.16.3.13 255.255.255.255 # 环回地址
ospf 1 router - id 11.11.11.11
area 2
network 172.16.3.0 0.0.0.3
network 172.16.3.4 0.0.0.3
network 172.16.3.12 0.0.0.0
R12
sysname R12
interface GigabitEthernet0/0/0
ip address 172.16.3.6 255.255.255.252 # area2内与R11相连链路IP
interface LoopBack0
ip address 172.16.3.17 255.255.255.255 # 环回地址
ospf 1 router - id 12.12.12.12
area 2
network 172.16.3.4 0.0.0.3
network 172.16.3.12 0.0.0.0