配置IP R1: [r1-GigabitEthernet0/0/0] ip address 192.168.1.1 24 [r1-LoopBack0] ip address 1.1.1.1 24 R2: [r2-GigabitEthernet0/0/0] ip address 192.168.2.1 24 [r2-LoopBack0] ip address 2.2.2.2 24 R3: [r3-GigabitEthernet0/0/0] ip address 192.168.3.1 24 [r3-GigabitEthernet0/0/1] ip address 192.168.3.2 24 [r3-LoopBack0] ip address 3.3.3.3 24 R4: [r4-GigabitEthernet0/0/0] ip address 192.168.4.1 24 [r4-LoopBack0] ip address 4.4.4.4 24
3、配置OSPF协议
R1: [r1]ospf 1 router-id 192.168.1.1 [r1-ospf-1]area 0 [r1-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.0 [r1-ospf-1-area-0.0.0.0]network 192.168.1.65 0.0.0.0 R2: [r2]ospf 1 router-id 192.168.1.2 [r2-ospf-1]area 0 [r2-ospf-1-area-0.0.0.0]network 192.168.1.2 0.0.0.0 [r2-ospf-1-area-0.0.0.0]network 192.168.1.129 0.0.0.0 R3: [r3]ospf 1 router-id 192.168.1.3 [r3-ospf-1]area 0 [r3-ospf-1-area-0.0.0.0]network 192.168.1.3 0.0.0.0 [r3-ospf-1-area-0.0.0.0]network 192.168.193. 0.0.0.0 [r3]ospf 2 router-id 192.168.1.9 [r3-ospf-1]area 1 [r3-ospf-1-area-0.0.0.1]network 192.168.1.9 0.0.0.0 R4: [r4]ospf 1 router-id 192.168.1.10 [r4-ospf-1]area 1 [r4-ospf-1-area-0.0.0.1]network 192.168.1.10 0.0.0.0
区域0环回 [r1]int LoopBack 0 [r1-LoopBack0]ip add 192.168.1.11 27
[r2]int LoopBack 0 [r2-LoopBack0]ip add 192.168.1.22 27
[r3]int LoopBack 0 [r3-LoopBack0]ip add 192.168.1.33 27
Area1环回 [r4]int LoopBack 0 [r4-LoopBack0]ip add 192.168.1.44 27 [r4-LoopBack0]int LoopBack 1 [r4-LoopBack1]ip add 4.4.4.4 24
R1-R3 R1为DR设备,没有BDR. [r2-GigabitEthernet0/0/0]ospf dr-priority 0 [r3-GigabitEthernet0/0/0]ospf dr-priority 0
|