HCNA-29 OSPF 单区域配置
基本配置: <Huawei>system-view [Huawei]sysnamer1 [r1]interfaceGigabitEthernet 0/0/0 [r1-GigabitEthernet0/0/0]ipaddress 192.168.10.1 24 [r1-GigabitEthernet0/0/0]interfaceGigabitEthernet 0/0/1 [r1-GigabitEthernet0/0/1]ipaddress 172.16.12.1 24 [r1-GigabitEthernet0/0/1]interface GigabitEthernet 0/0/2 [r1-GigabitEthernet0/0/2]ipaddress 172.16.13.1 24 [r1-GigabitEthernet0/0/2]quit [r1]displayip interface brief *down:administratively down ^down:standby (l):loopback (s):spoofing Thenumber of interface that is UP in Physical is 4 Thenumber of interface that is DOWN in Physical is 0 Thenumber of interface that is UP in Protocol is 4 Thenumber of interface that is DOWN in Protocol is 0 Interface IP Address/Mask Physical Protocol GigabitEthernet0/0/0 192.168.10.1/24 up up GigabitEthernet0/0/1 172.16.12.1/24 up up GigabitEthernet0/0/2 172.16.13.1/24 up up NULL0 unassigned up up(s) <Huawei>system-view [Huawei]sysnamer2 [r2]interfaceGigabitEthernet 0/0/2 [r2-GigabitEthernet0/0/2]ipaddress 192.168.20.1 24 [r2-GigabitEthernet0/0/2]interfaceGigabitEthernet 0/0/0 [r2-GigabitEthernet0/0/0]ipaddress 172.16.12.2 24 [r2-GigabitEthernet0/0/0]interfaceGigabitEthernet 0/0/1 [r2-GigabitEthernet0/0/1]ipaddress 172.16.23.2 24 [r2-GigabitEthernet0/0/1]quit <Huawei>system-view [Huawei]sysnamer3 [r3]interfaceGigabitEthernet 0/0/1 [r3-GigabitEthernet0/0/1]ipaddress 172.16.13.3 24 [r3-GigabitEthernet0/0/1]interfaceGigabitEthernet 0/0/0 [r3-GigabitEthernet0/0/0]ipaddress 172.16.23.3 24 [r3-GigabitEthernet0/0/0]interface GigabitEthernet 0/0/2 [r3-GigabitEthernet0/0/2]ipaddress 192.168.30.1 24 [r3-GigabitEthernet0/0/2]quit 配置单区域OSPF网络 <r1>system-view [r1]ospf1 //创建OSPF 进程号为1 [r1-ospf-1]area 0 //创建骨干区域0 [r1-ospf-1-area-0.0.0.0]network172.16.12.0 0.0.0.255 //宣告参与网络 后面是通配符掩码 [r1-ospf-1-area-0.0.0.0]network172.16.13.0 0.0.0.255 [r1-ospf-1-area-0.0.0.0]network192.168.10.0 0.0.0.255 [r1-ospf-1-area-0.0.0.0]quit [r1-ospf-1]quit [r1]displayospf interface //查看OSPF接口 OSPF Process 1 with Router ID 192.168.10.1 Interfaces Area: 0.0.0.0 (MPLS TE not enabled) IP Address Type State Cost Pri DR BDR 192.168.10.1 Broadcast DR 1 1 192.168.10.1 0.0.0.0 172.16.12.1 Broadcast DR 1 1 172.16.12.1 0.0.0.0 172.16.13.1 Broadcast DR 1 1 172.16.13.1 0.0.0.0 <r2>system-view [r2]ospf1 [r2-ospf-1]area0 [r2-ospf-1-area-0.0.0.0]network172.16.12.0 0.0.0.255 [r2-ospf-1-area-0.0.0.0]network172.16.23.0 0.0.0.255 [r2-ospf-1-area-0.0.0.0]network192.168.20.0 0.0.0.255 <r3>system-view [r3]ospf1 [r3-ospf-1]area0 [r3-ospf-1-area-0.0.0.0]network172.16.23.0 0.0.0.255 [r3-ospf-1-area-0.0.0.0]network172.16.13.0 0.0.0.255 [r3-ospf-1-area-0.0.0.0]network192.168.30.0 0.0.0.255 [r1]displayospf peer //查看OSPF 邻居状态 OSPF Process 1 with Router ID 192.168.10.1 Neighbors Area 0.0.0.0 interface172.16.12.1(GigabitEthernet0/0/1)'s neighbors Router ID: 192.168.20.1 Address: 172.16.12.2 State: Full Mode:Nbr is Master Priority: 1 DR: 172.16.12.1 BDR: 172.16.12.2 MTU: 0 Dead timer due in 37 sec Retrans timer interval: 5 Neighbor is up for 00:10:25 Authentication Sequence: [ 0 ] Neighbors Area 0.0.0.0 interface172.16.13.1(GigabitEthernet0/0/2)'s neighbors Router ID: 172.16.13.3 Address: 172.16.13.3 State: Full Mode:Nbr is Slave Priority: 1 DR: 172.16.13.1 BDR: 172.16.13.3 MTU: 0 Dead timer due in 36 sec Retrans timer interval: 5 Neighbor is up for 00:07:25 Authentication Sequence: [ 0 ] [r1]displayip routing-table protocol ospf //查看OSPF路由表 RouteFlags: R - relay, D - download to fib ------------------------------------------------------------------------------ Publicrouting table : OSPF Destinations : 3 Routes : 4 OSPFrouting table status : <Active> Destinations : 3 Routes : 4 Destination/Mask Proto Pre Cost Flags NextHop Interface 172.16.23.0/24 OSPF 10 2 D 172.16.12.2 GigabitEthernet 0/0/1 OSPF 10 2 D 172.16.13.3 GigabitEthernet 0/0/2 192.168.20.0/24 OSPF 10 2 D 172.16.12.2 GigabitEthernet 0/0/1 192.168.30.0/24 OSPF 10 2 D 172.16.13.3 GigabitEthernet 0/0/2 OSPFrouting table status : <Inactive> Destinations : 0 Routes : 0
|