R1:
int lo0
ip add 1.1.1.1 255.255.255.0
ip ospf network point-to-point
int s0/0/0
ip add 192.168.12.1 255.255.255.0
no shut
router ospf 1
router-id 1.1.1.1
network 1.1.1.0 0.0.0.255 area 0
network 192.168.12.0 0.0.0.255 area 0
R2:
int lo0
ip add 2.2.2.2 255.255.255.0
ip ospf network point-to-point
int s0/0/0
ip add 192.168.12.2 255.255.255.0
no shut
int s0/0/1
ip add 192.168.23.2 255.255.255.0
no shut
router ospf 1
router-id 2.2.2.2
network 192.168.12.0 0.0.0.255 area 0
network 2.2.2.0 0.0.0.255 area 0
network 192.168.23.0 0.0.0.255 area 1
area 1 virtual-link 3.3.3.3 //配置虚链路
R3:
int lo0
ip add 3.3.3.3 255.255.255.0
ip ospf network point-to-point
int s0/0/1
ip add 192.168.23.3 255.255.255.0
no shut
int s0/0/0
ip add 192.168.34.3 255.255.255.0
no shut
router ospf 1
router-id 3.3.3.3
network 192.168.23.0 0.0.0.255 area 1
network 3.3.3.0 0.0.0.255 area 0
network 192.168.34.0 0.0.0.255 area 0
area 1 virtual-link 2.2.2.2
R4:
int lo0
ip add 4.4.4.4 255.255.255.0
ip ospf network point-to-point
int s0/0/0
ip add 192.168.34.4 255.255.255.0
no shut
router ospf 1
router-id 4.4.4.4
network 192.168.34.0 0.0.0.255 area 0
network 4.4.4.0 0.0.0.255 area 0
配置虚链路的时候,“virtual-link”后一定要互指对方的路由器ID