22 单区域OSPF
R1 基本配置 <H3C>system-view [H3C]sysname r1 [r1]interface gigabitethernet 0/0 [r1-GigabitEthernet0/0]ip address 10.10.13.1 24 [r1-GigabitEthernet0/0]interface gigabitethernet 0/2 [r1-GigabitEthernet0/2]ip address 10.10.12.1 24 [r1-GigabitEthernet0/2]interface loopback 0 [r1-LoopBack0]ip address 1.1.1.1 32 [r1-LoopBack0]quit 配置OSPF [r1]router id 1.1.1.1 //创建设备全局Router ID [r1]ospf 1 //创建OSPF进程 [r1-ospf-1]description zurkj //配置OSPF进程描述 [r1-ospf-1]area 0 //配置OSPF区域 [r1-ospf-1-area-0.0.0.0]description zurkj //配置OSPF区域描述 [r1-ospf-1-area-0.0.0.0]authentication-mode md5 1 plainAa123456 //配置OSPF身份认证 [r1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0 //宣告OSPF参与网段 [r1-ospf-1-area-0.0.0.0]network 10.10.12.0 0.0.0.255 [r1-ospf-1-area-0.0.0.0]network 10.10.13.0 0.0.0.255 [r1-ospf-1-area-0.0.0.0]quit [r1-ospf-1]quit R2 <H3C>system-view [H3C]sysname r2 [r2]interface loopback 0 [r2-LoopBack0]ip address 2.2.2.2 32 [r2-LoopBack0]interface gigabitethernet 0/2 [r2-GigabitEthernet0/2]ip address 10.10.12.2 24 [r2-GigabitEthernet0/2]interface gigabitethernet 0/1 [r2-GigabitEthernet0/1]ip address 10.10.23.2 24 [r2-GigabitEthernet0/1]quit [r2]router id 2.2.2.2 [r2]ospf 1 [r2-ospf-1]description zurkj [r2-ospf-1]area 0 [r2-ospf-1-area-0.0.0.0]description zurkj [r2-ospf-1-area-0.0.0.1]authentication-mode md5 1 plainAa123456 [r2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0 [r2-ospf-1-area-0.0.0.0]network 10.10.12.0 0.0.0.255 [r2-ospf-1-area-0.0.0.0]network 10.10.23.0 0.0.0.255 [r2-ospf-1-area-0.0.0.0]quit [r2-ospf-1]quit R3 <H3C>system-view [H3C]sysname r3 [r3]interface loopback 0 [r3-LoopBack0]ip address 3.3.3.3 32 [r3-LoopBack0]interface gigabitethernet 0/0 [r3-GigabitEthernet0/0]ip address 10.10.13.3 24 [r3-GigabitEthernet0/0]interface gigabitethernet 0/1 [r3-GigabitEthernet0/1]ip address 10.10.23.3 24 [r3-GigabitEthernet0/1]quit [r3]router id 3.3.3.3 [r3]ospf 1 [r3-ospf-1]description zurkj [r3-ospf-1]area 0 [r3-ospf-1-area-0.0.0.0]description zurkj [r3-ospf-1-area-0.0.0.0]authentication-mode md5 1 plainAa123456 [r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0 [r3-ospf-1-area-0.0.0.0]network 10.10.13.0 0.0.0.255 [r3-ospf-1-area-0.0.0.0]network 10.10.23.0 0.0.0.255 [r3-ospf-1-area-0.0.0.0]quit [r3-ospf-1]quit 查看OSPF单区域路由表 [r3]display ip routing-table Destinations : 17 Routes : 18 Destination/Mask Proto Pre Cost NextHop Interface 0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0 1.1.1.1/32 O_INTRA 10 1 10.10.13.1 GE0/0 2.2.2.2/32 O_INTRA 10 1 10.10.23.2 GE0/1 3.3.3.3/32 Direct 0 0 127.0.0.1 InLoop0 10.10.12.0/24 O_INTRA 10 2 10.10.13.1 GE0/0 O_INTRA 10 2 10.10.23.2 GE0/1 …… [r3]display ospf routing 查看OSPF链路状态数据库和邻居信息 [r3]display ospf lsdb OSPFProcess 1 with Router ID 3.3.3.3 Link State Database Area: 0.0.0.0 Type LinkState ID AdvRouter Age Len Sequence Metric Router 3.3.3.3 3.3.3.3 633 60 8000000A 0 Router 1.1.1.1 1.1.1.1 647 60 8000000C 0 Router 2.2.2.2 2.2.2.2 637 60 8000000B 0 Network 10.10.23.2 2.2.2.2 626 32 80000002 0 Network 10.10.12.1 1.1.1.1 808 32 80000002 0 Network 10.10.13.1 1.1.1.1 641 32 80000002 0 [r3]display ospf peer OSPFProcess 1 with Router ID 3.3.3.3 Neighbor Brief Information Area: 0.0.0.0 Router ID Address Pri Dead-Time State Interface 1.1.1.1 10.10.13.1 1 36 Full/DR GE0/0 2.2.2.2 10.10.23.2 1 31 Full/DR GE0/1
|