新华三OSPF学习

embedded/2024/12/20 7:18:11/


OSPF-基配置演示

ospf dr-priority #修改竞选DR优先级


R1

[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0/0]interface g0/0/1
[R1-GigabitEthernet0/0/1]ip add 10.1.12.1 24
[R1-GigabitEthernet0/0/1]interface g0/0/2
[R1-GigabitEthernet0/0/2]ip add 10.1.14.1 24[R1]ospf router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]qu
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ospf 1 area 0
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ospf 1 area 0
[R1-GigabitEthernet0/0/1]int g0/0/2
[R1-GigabitEthernet0/0/2]ospf 1 area 0
[R1]dis ospf peerOSPF Process 1 with Router ID 1.1.1.1Neighbor Brief InformationArea: 0.0.0.0Router ID       Address         Pri Dead-Time  State             Interface2.2.2.2         10.1.12.2       1   39         Full/BDR          GE0/0/14.4.4.4         10.1.14.4       1   32         Full/BDR          GE0/0/2[R1]dis ip routing-tableDestinations : 16       Routes : 17Destination/Mask   Proto   Pre Cost        NextHop         Interface
10.1.12.0/24       Direct  0   0           10.1.12.1       GE0/0/1
10.1.12.1/32       Direct  0   0           127.0.0.1       GE0/0/1
10.1.12.255/32     Direct  0   0           10.1.12.1       GE0/0/1
10.1.14.0/24       Direct  0   0           10.1.14.1       GE0/0/2
10.1.14.1/32       Direct  0   0           127.0.0.1       GE0/0/2
10.1.14.255/32     Direct  0   0           10.1.14.1       GE0/0/2
10.1.23.0/24       O_INTRA 10  2           10.1.12.2       GE0/0/1
10.1.34.0/24       O_INTRA 10  2           10.1.14.4       GE0/0/2
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
192.168.1.0/24     Direct  0   0           192.168.1.254   GE0/0/0
192.168.1.254/32   Direct  0   0           127.0.0.1       GE0/0/0
192.168.1.255/32   Direct  0   0           192.168.1.254   GE0/0/0
192.168.2.0/24     O_INTRA 10  3           10.1.12.2       GE0/0/1O_INTRA 10  3           10.1.14.4       GE0/0/2
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
R2
[R2]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip add 10.1.12.1 24
[R2-GigabitEthernet0/0/0]interface g0/0/2
[R2-GigabitEthernet0/0/2]ip add 10.1.23.2 24[R2]ospf router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]qu
[R2-ospf-1]qu
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ospf 1 ar
[R2-GigabitEthernet0/0/1]ospf 1 area 0
[R2-GigabitEthernet0/0/1]int g0/0/2
[R2-GigabitEthernet0/0/2]ospf 1 area 0
[R2-GigabitEthernet0/0/2]qu
[R2]dis ospf peOSPF Process 1 with Router ID 2.2.2.2Neighbor Brief InformationArea: 0.0.0.0Router ID       Address         Pri Dead-Time  State             Interface1.1.1.1         10.1.12.1       1   38         Full/DR           GE0/0/13.3.3.3         10.1.23.3       1   37         Full/DR           GE0/0/2[R2]dis ip routing-tableDestinations : 14       Routes : 14Destination/Mask   Proto   Pre Cost        NextHop         Interface
10.1.12.0/24       Direct  0   0           10.1.12.2       GE0/0/1
10.1.12.2/32       Direct  0   0           127.0.0.1       GE0/0/1
10.1.12.255/32     Direct  0   0           10.1.12.2       GE0/0/1
10.1.14.0/24       O_INTRA 10  2           10.1.12.1       GE0/0/1
10.1.23.0/24       Direct  0   0           10.1.23.2       GE0/0/2
10.1.23.2/32       Direct  0   0           127.0.0.1       GE0/0/2
10.1.23.255/32     Direct  0   0           10.1.23.2       GE0/0/2
10.1.34.0/24       O_INTRA 10  2           10.1.23.3       GE0/0/2
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
192.168.1.0/24     O_INTRA 10  2           10.1.12.1       GE0/0/1
192.168.2.0/24     O_INTRA 10  2           10.1.23.3       GE0/0/2
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
R3
[R3]interface GigabitEthernet 0/0/2
[R3-GigabitEthernet0/0/2]ip add 10.1.23.3 24
[R3-GigabitEthernet0/0/2]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ip add 10.1.34.3 24
[R3-GigabitEthernet0/0/1]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.2.254 24[R3]ospf router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]qu
[R3]int g0/0/2
[R3-GigabitEthernet0/0/2]ospf 1 area 0
[R3-GigabitEthernet0/0/2]int g0/0/1
[R3-GigabitEthernet0/0/1]ospf 1 area 0
[R3-GigabitEthernet0/0/1]int g0/0/0
[R3-GigabitEthernet0/0/0]ospf 1 area 0
[R3-GigabitEthernet0/0/0]qu
[R3]dis ospf peerOSPF Process 1 with Router ID 3.3.3.3Neighbor Brief InformationArea: 0.0.0.0Router ID       Address         Pri Dead-Time  State             Interface4.4.4.4         10.1.34.4       1   36         Full/BDR          GE0/0/12.2.2.2         10.1.23.2       1   35         Full/BDR [R3]dis ip routing-tableDestinations : 16       Routes : 17Destination/Mask   Proto   Pre Cost        NextHop         Interface
10.1.12.0/24       O_INTRA 10  2           10.1.23.2       GE0/0/2
10.1.14.0/24       O_INTRA 10  2           10.1.34.4       GE0/0/1
10.1.23.0/24       Direct  0   0           10.1.23.3       GE0/0/2
10.1.23.3/32       Direct  0   0           127.0.0.1       GE0/0/2
10.1.23.255/32     Direct  0   0           10.1.23.3       GE0/0/2
10.1.34.0/24       Direct  0   0           10.1.34.3       GE0/0/1
10.1.34.3/32       Direct  0   0           127.0.0.1       GE0/0/1
10.1.34.255/32     Direct  0   0           10.1.34.3       GE0/0/1
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
192.168.1.0/24     O_INTRA 10  3           10.1.23.2       GE0/0/2O_INTRA 10  3           10.1.34.4       GE0/0/1
192.168.2.0/24     Direct  0   0           192.168.2.254   GE0/0/0
192.168.2.254/32   Direct  0   0           127.0.0.1       GE0/0/0
192.168.2.255/32   Direct  0   0           192.168.2.254   GE0/0/0
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
R4
[R4]int g0/0/2
[R4-GigabitEthernet0/0/2]ip add 10.1.14.4 24
[R4-GigabitEthernet0/0/2]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 10.1.34.4 24
[R4]ospf router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]qu
[R4-ospf-1]qu
[R4]int g0/0/2
[R4-GigabitEthernet0/0/2]ospf 1 area 0
[R4-GigabitEthernet0/0/2]int g0/0/2%Sep 27 11:33:03:278 2024 R4 OSPF/3/OSPF_NBR_CHG: OSPF 1 Neighbor 10.1.14.1(GigabitEthernet0/0/2) changed from LOADING to FULL.[R4-GigabitEthernet0/0/2]int g0/0/1
[R4-GigabitEthernet0/0/1]ospf 1 area 0
[R4-GigabitEthernet0/0/1]%Sep 27 11:33:22:334 2024 R4 OSPF/3/OSPF_NBR_CHG: OSPF 1 Neighbor 10.1.34.3(GigabitEthernet0/0/1) changed from LOADING to FULL.
[R4]dis ospf peerOSPF Process 1 with Router ID 4.4.4.4Neighbor Brief InformationArea: 0.0.0.0Router ID       Address         Pri Dead-Time  State             Interface3.3.3.3         10.1.34.3       1   33         Full/DR           GE0/0/11.1.1.1         10.1.14.1       1   34         Full/DR           GE0/0/2[R4]dis ip routing-tableDestinations : 14       Routes : 14Destination/Mask   Proto   Pre Cost        NextHop         Interface
10.1.12.0/24       O_INTRA 10  2           10.1.14.1       GE0/0/2
10.1.14.0/24       Direct  0   0           10.1.14.4       GE0/0/2
10.1.14.4/32       Direct  0   0           127.0.0.1       GE0/0/2
10.1.14.255/32     Direct  0   0           10.1.14.4       GE0/0/2
10.1.23.0/24       O_INTRA 10  2           10.1.34.3       GE0/0/1
10.1.34.0/24       Direct  0   0           10.1.34.4       GE0/0/1
10.1.34.4/32       Direct  0   0           127.0.0.1       GE0/0/1
10.1.34.255/32     Direct  0   0           10.1.34.4       GE0/0/1
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
192.168.1.0/24     O_INTRA 10  2           10.1.14.1       GE0/0/2
192.168.2.0/24     O_INTRA 10  2           10.1.34.3       GE0/0/1
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

OSPF多区域配置

![](https://i-blog.csdnimg.cn/img_convert/675948ec4396c4a2e244275ecf92f08c.png) area0必须在所有区域中间,因为area0时主干区域 R1
[R1]ospf router-id 1.1.1.1
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]qu
[R1-ospf-1]qu
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 10.1.12.1 24
[R1-GigabitEthernet0/0/1]ospf 1 area 1[R1]dis ospf peerOSPF Process 1 with Router ID 1.1.1.1Neighbor Brief InformationArea: 0.0.0.1Router ID       Address         Pri Dead-Time  State             Interface2.2.2.2         10.1.12.2       1   39         Full/BDR          GE0/0/1
[R1]dis ip routing-tableDestinations : 14       Routes : 14Destination/Mask   Proto   Pre Cost        NextHop         Interface
10.1.12.0/24       Direct  0   0           10.1.12.1       GE0/0/1
10.1.12.1/32       Direct  0   0           127.0.0.1       GE0/0/1
10.1.12.255/32     Direct  0   0           10.1.12.1       GE0/0/1
10.1.23.0/24       O_INTER 10  2           10.1.12.2       GE0/0/1
10.1.34.0/24       O_INTER 10  3           10.1.12.2       GE0/0/1
10.1.45.0/24       O_INTER 10  4           10.1.12.2       GE0/0/1
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
192.168.1.0/24     Direct  0   0           192.168.1.254   GE0/0/0
192.168.1.254/32   Direct  0   0           127.0.0.1       GE0/0/0
192.168.1.255/32   Direct  0   0           192.168.1.254   GE0/0/0
192.168.2.0/24     O_INTER 10  5           10.1.12.2       GE0/0/1
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
R2
[R2]ospf router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]qu
[R2-ospf-1]area 1
[R2-ospf-1]qu
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 10.1.12.2 24
[R2-GigabitEthernet0/0/1]ospf 1 area 1
[R2-GigabitEthernet0/0/2]int g0/0/2
[R2-GigabitEthernet0/0/2]ip add 10.1.23.2 24
[R2-GigabitEthernet0/0/2]ospf 1 area 0
[R2-GigabitEthernet0/0/2]qu<R2>dis ospf peerOSPF Process 1 with Router ID 2.2.2.2Neighbor Brief InformationArea: 0.0.0.0Router ID       Address         Pri Dead-Time  State             Interface3.3.3.3         10.1.23.3       1   39         Full/BDR          GE0/0/2Area: 0.0.0.1Router ID       Address         Pri Dead-Time  State             Interface1.1.1.1         10.1.12.1       1   40         Full/DR           GE0/0/1
<R2>dis ip routing-tableDestinations : 14       Routes : 14Destination/Mask   Proto   Pre Cost        NextHop         Interface
10.1.12.0/24       Direct  0   0           10.1.12.2       GE0/0/1
10.1.12.2/32       Direct  0   0           127.0.0.1       GE0/0/1
10.1.12.255/32     Direct  0   0           10.1.12.2       GE0/0/1
10.1.23.0/24       Direct  0   0           10.1.23.2       GE0/0/2
10.1.23.2/32       Direct  0   0           127.0.0.1       GE0/0/2
10.1.23.255/32     Direct  0   0           10.1.23.2       GE0/0/2
10.1.34.0/24       O_INTRA 10  2           10.1.23.3       GE0/0/2
10.1.45.0/24       O_INTER 10  3           10.1.23.3       GE0/0/2
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
192.168.1.0/24     O_INTRA 10  2           10.1.12.1       GE0/0/1
192.168.2.0/24     O_INTER 10  4           10.1.23.3       GE0/0/2
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
R3
[R3]ospf router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]end
[R3]int g0/0/2
[R3-GigabitEthernet0/0/2]ip add 10.1.23.3 24
[R3-GigabitEthernet0/0/2]ospf 1 area 0
[R3-GigabitEthernet0/0/2]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 10.1.34.3 24
[R3-GigabitEthernet0/0/1]ospf 1 area 0[R3]dis ospf peerOSPF Process 1 with Router ID 3.3.3.3Neighbor Brief InformationArea: 0.0.0.0Router ID       Address         Pri Dead-Time  State             Interface4.4.4.4         10.1.34.4       1   32         Full/BDR          GE0/0/12.2.2.2         10.1.23.2       1   33         Full/DR           GE0/0/2
[R3]dis ip routing-tableDestinations : 14       Routes : 14Destination/Mask   Proto   Pre Cost        NextHop         Interface
10.1.12.0/24       O_INTER 10  2           10.1.23.2       GE0/0/2
10.1.23.0/24       Direct  0   0           10.1.23.3       GE0/0/2
10.1.23.3/32       Direct  0   0           127.0.0.1       GE0/0/2
10.1.23.255/32     Direct  0   0           10.1.23.3       GE0/0/2
10.1.34.0/24       Direct  0   0           10.1.34.3       GE0/0/1
10.1.34.3/32       Direct  0   0           127.0.0.1       GE0/0/1
10.1.34.255/32     Direct  0   0           10.1.34.3       GE0/0/1
10.1.45.0/24       O_INTER 10  2           10.1.34.4       GE0/0/1
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
192.168.1.0/24     O_INTER 10  3           10.1.23.2       GE0/0/2
192.168.2.0/24     O_INTER 10  3           10.1.34.4       GE0/0/1
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
R4
[R5]ospf router-id 5.5.5.5
[R5-ospf-1]area 2
[R5-ospf-1-area-0.0.0.2]qu
[R5-ospf-1]qu
[R5]int g0/0/2
[R5-GigabitEthernet0/0/2]ip add 10.1.45.5 24
[R5-GigabitEthernet0/0/2]ospf 1 area 2
[R5-GigabitEthernet0/0/2]ip add 192.168.2.254 24
[R5-GigabitEthernet0/0/2]ospf 1 area 2[R4]dis ospf peerOSPF Process 1 with Router ID 4.4.4.4Neighbor Brief InformationArea: 0.0.0.0Router ID       Address         Pri Dead-Time  State             Interface3.3.3.3         10.1.34.3       1   32         Full/DR           GE0/0/1Area: 0.0.0.2Router ID       Address         Pri Dead-Time  State             Interface5.5.5.5         10.1.45.5       1   30         Full/BDR          GE0/0/2
[R4]dis ip routing-tableDestinations : 14       Routes : 14Destination/Mask   Proto   Pre Cost        NextHop         Interface
10.1.12.0/24       O_INTER 10  3           10.1.34.3       GE0/0/1
10.1.23.0/24       O_INTRA 10  2           10.1.34.3       GE0/0/1
10.1.34.0/24       Direct  0   0           10.1.34.4       GE0/0/1
10.1.34.4/32       Direct  0   0           127.0.0.1       GE0/0/1
10.1.34.255/32     Direct  0   0           10.1.34.4       GE0/0/1
10.1.45.0/24       Direct  0   0           10.1.45.4       GE0/0/2
10.1.45.4/32       Direct  0   0           127.0.0.1       GE0/0/2
10.1.45.255/32     Direct  0   0           10.1.45.4       GE0/0/2
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
192.168.1.0/24     O_INTER 10  4           10.1.34.3       GE0/0/1
192.168.2.0/24     O_INTRA 10  2           10.1.45.5       GE0/0/2
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
[R4]
R5
[R5]ospf router-id 5.5.5.5
[R5-ospf-1]area 2
[R5-ospf-1-area-0.0.0.2]qu
[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 192.168.2.254 24
[R5-GigabitEthernet0/0/0]ospf 1 area 2
[R5-GigabitEthernet0/0/0]int g0/0/2
[R5-GigabitEthernet0/0/2]ip add 10.1.45.5 24
[R5-GigabitEthernet0/0/2]ospf 1 area 2[R5]dis ospf peerOSPF Process 1 with Router ID 5.5.5.5Neighbor Brief InformationArea: 0.0.0.2Router ID       Address         Pri Dead-Time  State             Interface4.4.4.4         10.1.45.4       1   38         Full/DR           GE0/0/2[R5]dis ip routing-tableDestinations : 14       Routes : 14Destination/Mask   Proto   Pre Cost        NextHop         Interface
10.1.12.0/24       O_INTER 10  4           10.1.45.4       GE0/0/2
10.1.23.0/24       O_INTER 10  3           10.1.45.4       GE0/0/2
10.1.34.0/24       O_INTER 10  2           10.1.45.4       GE0/0/2
10.1.45.0/24       Direct  0   0           10.1.45.5       GE0/0/2
10.1.45.5/32       Direct  0   0           127.0.0.1       GE0/0/2
10.1.45.255/32     Direct  0   0           10.1.45.5       GE0/0/2
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
192.168.1.0/24     O_INTER 10  5           10.1.45.4       GE0/0/2
192.168.2.0/24     Direct  0   0           192.168.2.254   GE0/0/0
192.168.2.254/32   Direct  0   0           127.0.0.1       GE0/0/0
192.168.2.255/32   Direct  0   0           192.168.2.254   GE0/0/0
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
[R5]

OSPF多区域和引入外部路由(路由重发布)配置实验

实验目的:熟悉OSPF协议和了解什么是引入外部路由 拓扑图 ![](https://i-blog.csdnimg.cn/img_convert/993da611355d3ae0213f89b0ca3699b8.png)

R1

c
[H3C]sysname R1
[R1-GigabitEthernet0/0/0]ip add 10.0.12.1 24
[R1-GigabitEthernet0/0/0]
R2
c
[H3C]sysname R2
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 10.0.12.2 24
[R2-GigabitEthernet0/0/1]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 10.0.23.2 24
R3
c
[H3C]sysname R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 10.0.23.3 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 10.0.34.3 24
R4
c
[H3C]sysname R4
[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 10.0.45.4 24
[R4-GigabitEthernet0/0/1]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 10.0.34.4 24
R5
c
[H3C]sysname R5
[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 10.0.45.5 24
[R5-GigabitEthernet0/0/0]quit
[R5]int LoopBack 0
[R5-LoopBack0]ip add 5.5.5.5 24

R1

c
[R1]route id 10.0.12.1
[R1]ospf 1
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]network 10.0.12.1 0.0.0.0
R2
c
[R2]router id 10.0.23.2
[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]network 10.0.12.2 0.0.0.0
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.0.23.2 0.0.0.0
R3
c
[R3]router id 10.0.23.3
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.0.23.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]area 2
[R3-ospf-1-area-0.0.0.2]network 10.0.34.3 0.0.0.0
R4
c
[R4]router id 10.0.34.4
[R4]ospf 1
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]qu
[R4-ospf-1]area 2
[R4-ospf-1-area-0.0.0.2]network 10.0.34.4 0.0.0.0
[R4]ip route-static 5.5.5.5 24 10.0.45.5
[R4]ospf 1
[R4-ospf-1]import-route static
[R4-ospf-1]import-route direct
R5
c
[R5]ip route-static 0.0.0.0 0 10.0.45.4

查看R4 OSPF邻居表

C
<R4>dis ospf routingOSPF Process 1 with Router ID 10.0.34.4Routing TableTopology base (MTID 0)Routing for networkDestination        Cost     Type    NextHop         AdvRouter       Area10.0.12.0/24       3        Inter   10.0.34.3       10.0.23.3       0.0.0.210.0.23.0/24       2        Inter   10.0.34.3       10.0.23.3       0.0.0.210.0.34.0/24       1        Transit 0.0.0.0         10.0.23.3       0.0.0.2
查看R1 ip地址表
c
<R1>show ip routDestinations : 11       Routes : 11Destination/Mask   Proto   Pre Cost        NextHop         Interface
5.5.5.0/24         O_ASE2  150 1           10.0.12.2       GE0/0/0
10.0.12.0/24       Direct  0   0           10.0.12.1       GE0/0/0
10.0.12.1/32       Direct  0   0           127.0.0.1       GE0/0/0
10.0.12.255/32     Direct  0   0           10.0.12.1       GE0/0/0
10.0.23.0/24       O_INTER 10  2           10.0.12.2       GE0/0/0
10.0.34.0/24       O_INTER 10  3           10.0.12.2       GE0/0/0
10.0.45.0/24       O_ASE2  150 1           10.0.12.2       GE0/0/0
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
测试联通R1pingR5
c
<R1>ping 5.5.5.5
Ping 5.5.5.5 (5.5.5.5): 56 data bytes, press CTRL+C to break
56 bytes from 5.5.5.5: icmp_seq=0 ttl=252 time=1.576 ms
56 bytes from 5.5.5.5: icmp_seq=1 ttl=252 time=1.848 ms
56 bytes from 5.5.5.5: icmp_seq=2 ttl=252 time=1.503 ms
56 bytes from 5.5.5.5: icmp_seq=3 ttl=252 time=1.646 ms
56 bytes from 5.5.5.5: icmp_seq=4 ttl=252 time=1.688 ms--- Ping statistics for 5.5.5.5 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 1.503/1.652/1.848/0.116 ms

OSPF多区域配置和引入外部缺省缺省路由配置实验

实验目的:OSPF熟练运用与缺省路由引入 拓扑图 ![](https://i-blog.csdnimg.cn/img_convert/fcdb9c56fd879e813e4bf1e9839208e1.png) ip地址配置 R1
c
[H3C]sysname R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 10.0.12.1 24
R2
c
[H3C]sysname R2
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 10.0.12.2 24
[R2-GigabitEthernet0/0/1]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 10.0.23.2 24
R3
c
[H3C]sysname R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 10.0.23.3 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 10.0.34.3 24
[R3-GigabitEthernet0/0/1]int g0/0/2
[R3-GigabitEthernet0/0/2]ip add 10.0.35.3 24
R4
c
[H3C]sysname R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 10.0.34.4 24
R6
c
[H3C]sysname R5
[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 10.0.35.5 24
[R5-GigabitEthernet0/0/0]qu
[R5]int loop
[R5]int LoopBack 0
[R5-LoopBack0]ip add 5.5.5.5 24
ospf宣告 R1
c
[R1]ospf 1
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]net
[R1-ospf-1-area-0.0.0.1]network 10.0.12.1 0.0.0.0
R2
c
[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]network 10.0.12.2 0.0.0.0
[R2-ospf-1-area-0.0.0.1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.0.23.2 0.0.0.0
R3
c
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.0.23.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]area 2
[R3-ospf-1-area-0.0.0.2]network 10.0.34.3 0.0.0.0
R4
c
[R4]ospf 1
[R4-ospf-1]area 2
[R4-ospf-1-area-0.0.0.2]network 10.0.34.4 0.0.0.0
查看R3 ospf邻居状态
c
[R3]dis ospf routingOSPF Process 1 with Router ID 10.0.35.3Routing TableTopology base (MTID 0)Routing for networkDestination        Cost     Type    NextHop         AdvRouter       Area10.0.12.0/24       2        Inter   10.0.23.2       10.0.23.2       0.0.0.010.0.23.0/24       1        Transit 0.0.0.0         10.0.23.2       0.0.0.010.0.34.0/24       1        Transit 0.0.0.0         10.0.35.3       0.0.0.2Total nets: 3Intra area: 2  Inter area: 1  ASE: 0  NSSA: 0
默认路由引入 R3
c
[R3]ospf 1
[R3-ospf-1]default-route-advertise always
internet返回路由配置 R5
c
[R5]ip route-static 0.0.0.0 0 10.0.35.3
查看R1和R5路由表
c
<R1>show ip routing-tableDestinations : 10       Routes : 10Destination/Mask   Proto   Pre Cost        NextHop         Interface
0.0.0.0/0          O_ASE2  150 1           10.0.12.2       GE0/0/0
10.0.12.0/24       Direct  0   0           10.0.12.1       GE0/0/0
10.0.12.1/32       Direct  0   0           127.0.0.1       GE0/0/0
10.0.12.255/32     Direct  0   0           10.0.12.1       GE0/0/0
10.0.23.0/24       O_INTER 10  2           10.0.12.2       GE0/0/0
10.0.34.0/24       O_INTER 10  3           10.0.12.2       GE0/0/0
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
c
[R5]dis ip routing-tableDestinations : 11       Routes : 11Destination/Mask   Proto   Pre Cost        NextHop         Interface
0.0.0.0/0          Static  60  0           10.0.35.3       GE0/0/0
5.5.5.0/24         Direct  0   0           5.5.5.5         Loop0
5.5.5.5/32         Direct  0   0           127.0.0.1       Loop0
5.5.5.255/32       Direct  0   0           5.5.5.5         Loop0
10.0.35.0/24       Direct  0   0           10.0.35.5       GE0/0/0
10.0.35.5/32       Direct  0   0           127.0.0.1       GE0/0/0
10.0.35.255/32     Direct  0   0           10.0.35.5       GE0/0/0
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
联通测试 R1ping R5
c
<R1>ping 10.0.35.5
Ping 10.0.35.5 (10.0.35.5): 56 data bytes, press CTRL+C to break
56 bytes from 10.0.35.5: icmp_seq=0 ttl=253 time=1.141 ms
56 bytes from 10.0.35.5: icmp_seq=1 ttl=253 time=1.142 ms
56 bytes from 10.0.35.5: icmp_seq=2 ttl=253 time=1.043 ms
56 bytes from 10.0.35.5: icmp_seq=3 ttl=253 time=1.114 ms
56 bytes from 10.0.35.5: icmp_seq=4 ttl=253 time=1.115 ms--- Ping statistics for 10.0.35.5 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 1.043/1.111/1.142/0.036 ms
R1ping R5 loopback0
c
<R1>ping 5.5.5.5
Ping 5.5.5.5 (5.5.5.5): 56 data bytes, press CTRL+C to break
56 bytes from 5.5.5.5: icmp_seq=0 ttl=253 time=1.231 ms
56 bytes from 5.5.5.5: icmp_seq=1 ttl=253 time=1.045 ms
56 bytes from 5.5.5.5: icmp_seq=2 ttl=253 time=0.991 ms
56 bytes from 5.5.5.5: icmp_seq=3 ttl=253 time=1.218 ms
56 bytes from 5.5.5.5: icmp_seq=4 ttl=253 time=1.128 ms--- Ping statistics for 5.5.5.5 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.991/1.123/1.231/0.094 ms

路由重发布(OSPF引入静态路由)配置实验

实验目的:在ospf中引入静态路由 拓扑 ![](https://i-blog.csdnimg.cn/img_convert/87feb0c7a326ed6bab04eeb4b8938e46.png) 1、IP地址配置 pc1 ![](https://i-blog.csdnimg.cn/img_convert/841289f5fd53fc152a504ad5ac6026f1.png) pc2 ![](https://i-blog.csdnimg.cn/img_convert/35b8bfaa9ad99936e0c6d0d26952b34d.png) R1
c
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.10.254 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.12.1 24
R2
c
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.12.2 24
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 192.168.23.2 24
R3
c
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.23.3 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.20.254 24

R1配置静态路由

c
[R1]ip route-static 192.168.23.0 24 192.168.12.2
[R1]ip route-static 192.168.20.0 24 192.168.12.2
R2ospf宣告及引入静态路由
c
[R2]router id 192.169.23.2
[R2]ospf 1
[R2-ospf-1-area-0.0.0.0]network 192.168.23.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]exit
[R2-ospf-1]exit
[R2]ip route-static 192.168.10.0 24 192.168.12.1[R2]ospf 1
[R2-ospf-1]import-route static
R3ospf宣告及
c
[R3]router id 192.168.23.3
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 192.168.23.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 192.168.20.0 0.0.0.255
查看R2和R3邻居关系
c
[R2]show ospf interfaceOSPF Process 1 with Router ID 192.169.23.2InterfacesArea: 0.0.0.0IP Address      Type      State    Cost  Pri   DR              BDR192.168.23.2    Broadcast DR       1     1     192.168.23.2    192.168.23.3[R3]show ospf interfaceOSPF Process 1 with Router ID 192.168.23.3InterfacesArea: 0.0.0.0IP Address      Type      State    Cost  Pri   DR              BDR192.168.23.3    Broadcast BDR      1     1     192.168.23.2    192.168.23.3192.168.20.254  Broadcast DR       1     1     192.168.20.254  0.0.0.0

查看R2路由表

c
[R2]show ip routDestinations : 12       Routes : 12Destination/Mask   Proto   Pre Cost        NextHop         Interface
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
192.168.10.0/24    Static  60  0           192.168.12.1    GE0/0/0
192.168.12.0/24    Direct  0   0           192.168.12.2    GE0/0/0
192.168.12.2/32    Direct  0   0           127.0.0.1       GE0/0/0
192.168.12.255/32  Direct  0   0           192.168.12.2    GE0/0/0
192.168.20.0/24    O_INTRA 10  2           192.168.23.3    GE0/0/1
192.168.23.0/24    Direct  0   0           192.168.23.2    GE0/0/1
192.168.23.2/32    Direct  0   0           127.0.0.1       GE0/0/1
192.168.23.255/32  Direct  0   0           192.168.23.2    GE0/0/1
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
查看R3路由表
c
[R3]show ip routing-tableDestinations : 11       Routes : 11Destination/Mask   Proto   Pre Cost        NextHop         Interface
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
192.168.10.0/24    O_ASE2  150 1           192.168.23.2    GE0/0/0
192.168.20.0/24    Direct  0   0           192.168.20.254  GE0/0/1
192.168.20.254/32  Direct  0   0           127.0.0.1       GE0/0/1
192.168.20.255/32  Direct  0   0           192.168.20.254  GE0/0/1
192.168.23.0/24    Direct  0   0           192.168.23.3    GE0/0/0
192.168.23.3/32    Direct  0   0           127.0.0.1       GE0/0/0
192.168.23.255/32  Direct  0   0           192.168.23.3    GE0/0/0
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
测试联通pc2pingpc1
c
<H3C>ping 192.168.10.1
Ping 192.168.10.1 (192.168.10.1): 56 data bytes, press CTRL_C to break
56 bytes from 192.168.10.1: icmp_seq=0 ttl=252 time=1.309 ms
56 bytes from 192.168.10.1: icmp_seq=1 ttl=252 time=1.718 ms
56 bytes from 192.168.10.1: icmp_seq=2 ttl=252 time=0.629 ms
56 bytes from 192.168.10.1: icmp_seq=3 ttl=252 time=1.290 ms
56 bytes from 192.168.10.1: icmp_seq=4 ttl=252 time=1.216 ms--- Ping statistics for 192.168.10.1 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.629/1.232/1.718/0.349 ms

在OSPF中引入静态路由时应用路由策略配置实验

实验目的:练习ospf和路由策略配置 拓扑图 ![](https://i-blog.csdnimg.cn/img_convert/e8fd617d33c7517497e1e838c8470e07.png) ip配置 R1
c
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 10.0.0.1 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.10.2 24
[R1-GigabitEthernet0/0/1]int g0/0/2
[R1-GigabitEthernet0/0/2]ip add 192.168.20.2 24
[R1-GigabitEthernet0/0/7]int g0/0/7
[R1-GigabitEthernet0/0/7]ip add 192.168.30.2 24
R2
c
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 10.0.0.2 24
R3
c
[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.10.1 24
[R3]int loopback 0
[R3-LoopBack0]ip add 172.16.1.1 24
R4
c
[R4]int g0/0/2
[R4-GigabitEthernet0/0/2]ip add 192.168.20.1 24
[R4]int loopback 0
[R4-LoopBack0]ip add 172.16.2.1 24
R5
c
[R5]int g0/0/7
[R5-GigabitEthernet0/0/7]ip add 192.168.30.1 24
[R5-LoopBack0]ip add 172.16.3.1 24
宣告ospf R1
c
[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 10.0.0.2 0.0.0.0
//添加静态路由
[R1]ip route-static 172.16.1.1 24 192.168.10.1
[R1]ip route-static 172.16.2.1 24 192.168.20.1
[R1]ip route-static 172.16.3.1 24 192.168.30.1
R2
c
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]net
[R2-ospf-1-area-0.0.0.0]network 10.0.0.2 0.0.0.0
配置路由策略 R1
c
[R1]ip prefix-list 1 index 1 permit 172.16.1.0 24
[R1]ip prefix-list 1 index 2 permit 172.16.3.0 24
[R1]ip prefix-list 1 index 3 deny 172.16.2.0 24 //禁止172.16.2.0网段的IP
//查看前缀列表
[R1]show ip prefix-list
Prefix-list: 1Permitted 0Denied 0index: 1         Permit 172.16.1.0/24index: 2         Permit 172.16.3.0/24index: 3         Deny   172.16.2.0/24[R1]route-policy 1 permit node 1 //创建路由策略
[R1-route-policy-1-1]if-match ip address prefix-list 1 //匹配前缀策略
[R1-route-policy-1-1]end[R1]ospf 1
[R1-ospf-1]import-route static route-policy 1 //引用测略,静止引用172.16.2.0网段的静态路由
查看R2路由表
c
[R2]dis ip routing-tableDestinations : 9        Routes : 9Destination/Mask   Proto   Pre Cost        NextHop         Interface
10.0.0.0/24        Direct  0   0           10.0.0.2        GE0/0/0
10.0.0.2/32        Direct  0   0           127.0.0.1       GE0/0/0
10.0.0.255/32      Direct  0   0           10.0.0.2        GE0/0/0
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
172.16.1.0/24      O_ASE2  150 1           10.0.0.1        GE0/0/0
172.16.3.0/24      O_ASE2  150 1           10.0.0.1        GE0/0/0
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
测试联通R3、R4、R5的回环地址pingR2
c
<R3>ping -a 172.16.1.1 10.0.0.2
Ping 10.0.0.2 (10.0.0.2) from 172.16.1.1: 56 data bytes, press CTRL+C to break
56 bytes from 10.0.0.2: icmp_seq=0 ttl=254 time=0.653 ms
56 bytes from 10.0.0.2: icmp_seq=1 ttl=254 time=0.673 ms
56 bytes from 10.0.0.2: icmp_seq=2 ttl=254 time=0.513 ms
56 bytes from 10.0.0.2: icmp_seq=3 ttl=254 time=0.574 ms
56 bytes from 10.0.0.2: icmp_seq=4 ttl=254 time=0.928 ms--- Ping statistics for 10.0.0.2 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.513/0.668/0.928/0.142 ms
<R3>%Dec  4 17:36:54:017 2024 R3 PING/6/PING_STATISTICS: Ping statistics for 10.0.0.2: 5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss, round-trip min/avg/max/std-dev = 0.513/0.668/0.928/0.142 ms.<R5>ping -a 172.16.3.1 10.0.0.2
Ping 10.0.0.2 (10.0.0.2) from 172.16.3.1: 56 data bytes, press CTRL+C to break
56 bytes from 10.0.0.2: icmp_seq=0 ttl=254 time=0.608 ms
56 bytes from 10.0.0.2: icmp_seq=1 ttl=254 time=0.953 ms
56 bytes from 10.0.0.2: icmp_seq=2 ttl=254 time=0.668 ms
56 bytes from 10.0.0.2: icmp_seq=3 ttl=254 time=0.279 ms
56 bytes from 10.0.0.2: icmp_seq=4 ttl=254 time=0.604 ms--- Ping statistics for 10.0.0.2 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.279/0.622/0.953/0.214 ms
<R5>%Dec  4 17:39:03:803 2024 R5 PING/6/PING_STATISTICS: Ping statistics for 10.0.0.2: 5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss, round-trip min/avg/max/std-dev = 0.279/0.622/0.953/0.214 ms.<R4>ping -a 172.16.2.1 10.0.0.2  //因为引用的静态路由策略禁止引用所以172.16.2.1ping不通R2
Ping 10.0.0.2 (10.0.0.2) from 172.16.2.1: 56 data bytes, press CTRL+C to break
Request time out
Request time out
Request time out
Request time out
Request time out--- Ping statistics for 10.0.0.2 ---
5 packet(s) transmitted, 0 packet(s) received, 100.0% packet loss

配置OSPF虚连接实验

实验目的:认识虚连接,了解配虚连接 拓扑图: ![](https://i-blog.csdnimg.cn/img_convert/b48621a37e7df3486f686d9f277122a9.png) ip配置 R1
c
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 10.0.0.1 24
[R1-GigabitEthernet0/0/0]qu
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 10.0.0.1 0.0.0.0
R2
c
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 10.0.0.2 24
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 192.168.10.1 24
[R2-GigabitEthernet0/0/1]qu
R3
c
[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.10.2 24
[R3-GigabitEthernet0/0/1]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 172.16.1.2 24
[R3-GigabitEthernet0/0/0]qu
R4
c
[R4]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip add 172.16.1.1 24
[R4-GigabitEthernet0/0/0]qu
ospf宣告 R1
c
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 10.0.0.1 0.0.0.0
R2
c
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.0.0.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]area 1
[R2-ospf-1-area-0.0.0.1]net 192.168.10.1 0.0.0.0
R3
c
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 192.168.10.2 0.0.0.0
[R3-ospf-1-area-0.0.0.1]area 2
[R3-ospf-1-area-0.0.0.2]network 172.16.1.2 0.0.0.0
R4
c
[R4]ospf 1 rou
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 2
[R4-ospf-1-area-0.0.0.2]network 172.16.1.1 0.0.0.0
创建虚连接 R2
c
[R2-ospf-1-area-0.0.0.1]vlink-peer 3.3.3.3
R3
c
[R3-ospf-1-area-0.0.0.1]vlink-peer 2.2.2.2
查看R1ospf路由表

R1

c
<R1>show ip routing-table protocol ospfSummary count : 3OSPF Routing table status : <Active>
Summary count : 2Destination/Mask   Proto   Pre Cost        NextHop         Interface
172.16.1.0/24      O_INTER 10  3           10.0.0.2        GE0/0/0
192.168.10.0/24    O_INTER 10  2           10.0.0.2        GE0/0/0OSPF Routing table status : <Inactive>
Summary count : 1Destination/Mask   Proto   Pre Cost        NextHop         Interface
10.0.0.0/24        O_INTRA 10  1           0.0.0.0
成功获取area2区域的路由,测试联通性,R1ping R4
c
<R1>ping 172.16.1.1
Ping 172.16.1.1 (172.16.1.1): 56 data bytes, press CTRL+C to break
56 bytes from 172.16.1.1: icmp_seq=0 ttl=253 time=0.761 ms
56 bytes from 172.16.1.1: icmp_seq=1 ttl=253 time=0.523 ms
56 bytes from 172.16.1.1: icmp_seq=2 ttl=253 time=1.140 ms
56 bytes from 172.16.1.1: icmp_seq=3 ttl=253 time=0.785 ms
56 bytes from 172.16.1.1: icmp_seq=4 ttl=253 time=0.806 ms--- Ping statistics for 172.16.1.1 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.523/0.803/1.140/0.197 ms
<R1>%Dec  5 11:12:00:556 2024 R1 PING/6/PING_STATISTICS: Ping statistics for 172.16.1.1: 5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss, round-trip min/avg/max/std-dev = 0.523/0.803/1.140/0.197 ms.

http://www.ppmy.cn/embedded/147213.html

相关文章

解释工厂模式

参考文献&#xff1a;C几种工厂模式和实现实例_工厂方法模式c实例-CSDN博客 什么是工厂模式 工厂模式是一种创建对象的设计模式&#xff0c;它提供了一种创建对象的方式&#xff0c;将对象的创建和使用分离 通过工厂模式&#xff0c;可以根据不同的条件创建不同类型的对象&a…

快消品 B2B 困境与破局:基于 2+1 链动模式与 S2B2C 商城小程序的思考

摘要&#xff1a;本文深入剖析了快消品 B2B 行业面临的困境&#xff0c;包括诸多平台的衰落以及在用户端、品牌商、中间商和零售小店多方面遭遇的阻碍&#xff0c;揭示其脱离 C 端用户、缺乏各方支持而陷入“姥姥不疼&#xff0c;舅舅不爱”的尴尬处境。在此基础上&#xff0c;…

uni-app创建微信小程序

UniApp 是一个基于 Vue.js 语法的跨平台开发框架&#xff0c;它允许开发者使用一套代码构建适用于 iOS 、 Android 、 Web 以及各种小程序和快应用的应用程序 一、环境搭建 安装使用教程&#xff1a;https://blog.csdn.net/YuanFudao/article/details/132384692 二、项目基本…

SpringBoot 整合 SQLite 数据库

1、SQLite 简介 SQLite 是一个很轻量的关系型数据库&#xff0c;不需要安装服务&#xff0c;数据存储在文件里。 2、引入pom依赖 <!-- SQLite --><dependency><groupId>org.xerial</groupId><artifactId>sqlite-jdbc</artifactId><v…

React 组件间的通信

React 父传子 实现&#xff1a; function Son(props){return <div>{ props.name }</div> } ​ ​ function App(){const name this is app namereturn (<div><Son name{name}/></div>) } 注意&#xff1a;这里可以传递任何类型&#xff0c;…

Flutter环境搭建

1.Flutter 简介 1.1 Flutter 是什么 &#xff1f; Flutter 是一个 UI SDK&#xff08;Software Development Kit&#xff09;跨平台解决方案&#xff1a;可以实现一套代码发布移动端&#xff08;iOS、Android、HarmonyOS&#xff09;、Web端、桌面端目前很多公司都在用它&…

第47节 ArkTS 创建自定义组件

在 ArkTS 中创建自定义组件是一个相对简单但功能强大的过程。以下是如何在 ArkTS 中创建和使用自定义组件的详细步骤&#xff1a; 一、定义自定义组件 1. 使用Component注解&#xff1a;为了注册一个组件&#xff0c;使其能够在其他文件中被引用&#xff0c;你需要使用Com…

2024 年最新前端ES-Module模块化、webpack打包工具详细教程(更新中)

模块化概述 什么是模块&#xff1f;模块是一个封装了特定功能的代码块&#xff0c;可以独立开发、测试和维护。模块通过导出&#xff08;export&#xff09;和导入&#xff08;import&#xff09;与其他模块通信&#xff0c;保持内部细节的封装。 前端 JavaScript 模块化是指…