配置
lsw2
[sw2]int GigabitEthernet 0/0/3
[sw2-GigabitEthernet0/0/3]port default vlan 3
[sw2]interface GigabitEthernet 0/0/1
[sw2-GigabitEthernet0/0/1]port link-type trunk
[sw2-GigabitEthernet0/0/1]port trunk allow-pass vlan all
ar1
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.15
[r1-ospf-1-area-0.0.0.0]network 192.168.1.33 0.0.0.0
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ospf dr-priority 0
ar2
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.1.34 28
[r2]interface LoopBack 0
[r2-LoopBack0]ip address 192.168.1.17 28
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1-area-0.0.0.0]network 192.168.1.16 0.0.0.15
[r2-ospf-1-area-0.0.0.0]network 192.168.1.34 0.0.0.0
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ospf dr-priority 0
ar3
ar4
[r4]interface GigabitEthernet 0/0/0
[r4-GigabitEthernet0/0/0]ip address 192.168.1.130 30
[r4]interface LoopBack 0
[r4-LoopBack0]ip address 4.4.4.1 24
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]area 1
[r4-ospf-1-area-0.0.0.1]network 192.168.1.130 0.0.0.0
ping
pc1
pc2
ar1