如图:
R1,R2,R3,R4属于骨干区域,PC3和PC4位骨干区域两台主机
R5,PC1属于area1,R6,PC2属于area2
配置命令:配置的时候还是指定router-id的好,要不真难找。
#R1
interface gigabitethernet0/0/0
ip addr 10.0.15.1 24
interface ethernet0/0/0
ip addr 10.0.12.1 24
interface ethernet0/0/1
ip addr 10.0.13.1 24
#R2
interface gigabitethernet0/0/0
ip addr 10.0.26.2 24
interface ethernet0/0/0
ip addr 10.0.12.2 24
interface ethernet0/0/1
ip addr 10.0.24.2 24
#R3
interface gigabitethernet0/0/0
ip addr 10.0.35.3 24
interface gigabitethernet0/0/1
ip addr 10.0.3.254 24
interface ethernet0/0/0
ip addr 10.0.34.3 24
interface ethernet0/0/1
ip addr 10.0.13.3 24
#R4
interface gigabitethernet0/0/0
ip addr 10.0.46.4 24
interface gigabitethernet0/0/1
ip addr 10.0.4.254 24
interface ethernet0/0/0
ip addr 10.0.34.4 24
interface ethernet0/0/1
ip addr 10.0.24.4 24
#R5
interface gigabitethernet0/0/0
ip addr 10.0.1.254 24
interface ethernet0/0/0
ip addr 10.0.15.5 24
interface ethernet0/0/1
ip addr 10.0.35.5 24
#R6
interface gigabitethernet0/0/0
ip addr 10.0.2.254 24
interface ethernet0/0/0
ip addr 10.0.26.6 24
interface ethernet0/0/1
ip addr 10.0.46.6 24
#骨干区域
#R1
ospf 1
area 0
network 10.0.12.0 0.0.0.255
network 10.0.13.0 0.0.0.255
#R2
ospf 1
area 0
network 10.0.12.0 0.0.0.255
network 10.0.24.0 0.0.0.255
#R3
ospf 1
area 0
network 10.0.13.0 0.0.0.255
network 10.0.34.0 0.0.0.255
network 10.0.3.0 0.0.0.255
#R4
ospf 1
area 0
network 10.0.24.0 0.0.0.255
network 10.0.34.0 0.0.0.255
network 10.0.4.0 0.0.0.255
#非骨干区域1
#R1
ospf 1
area 1
network 10.0.15.0 0.0.0.255
#R3
ospf 1
area 1
network 10.0.35.0 0.0.0.255
#R5
ospf 1
area 1
network 10.0.15.0 0.0.0.255
network 10.0.35.0 0.0.0.255
network 10.0.1.0 0.0.0.255