PC1
地址:192.168.1.1
掩码:255.255.255.0
网关:192.168.1.254
PC2
地址:192.168.2.1
掩码:255.255.255.0
网关:192.168.2.254
< Huawei>system-view /进系统视图
[Huawei]sysname AR1 /修改主机名为AR-1
[AR1]interface GigabitEthernet 0/0/2 /进G2接口
[AR1-GigabitEthernet0/0/2]ip address 192.168.1.254 255.255.255.0 /配置IP地址
[AR1]interface GigabitEthernet 0/0/0 /切换接口
[AR1-GigabitEthernet0/0/0]ip address 192.168.12.1 255.255.255.0 /配置IP地址
[AR1]ospf router-id 1.1.1.1 /给ospf 1 设置名称为1.1.1.1
[AR1-ospf-1]area 0 /进入骨干区域 0
[AR1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255 /在骨干区域内设置IP地址和反掩码地址
[AR1-ospf-1-area-0.0.0.0]network 192.168.12.0 0.0.0.255 /在骨干区域内设置IP地址和反掩码地址
=================================================================================
< Huawei>system-view /进系统视图
[Huawei]sysname AR2 /修改主机名为AR-2
[AR2]interface GigabitEthernet 0/0/0 /进G0接口
[AR2-GigabitEthernet0/0/0]ip address 192.168.23.2 255.255.255.0 /配置IP地址
[AR2]interface g0/0/1 /切换接口
[AR2-GigabitEthernet0/0/1]ip address 192.168.12.2 255.255.255.0 /配置IP地址
[AR2]ospf 1 router-id 2.2.2.2 /给ospf 1 配置个名字为2.2.2.2
[AR2-ospf-1]area 0 /进入骨干区域
[AR2-ospf-1-area-0.0.0.0]network 192.168.12.0 0.0.0.255 /配置IP地址和反掩码地址
[AR2-ospf-1-area-0.0.0.0]network 192.168.23.0 0.0.0.255 /配置IP地址和反掩码地址
[AR2]display ospf peer brief /查看ospf邻居关系表
=================================================================================
< Huawei>system-view /进系统视图
[Huawei]sysname AR3 /修改主机名为AR-3
[AR3]interface GigabitEthernet 0/0/2 /进G2接口
[AR3-GigabitEthernet0/0/2]ip address 192.168.2.254 255.255.255.0 /配置IP地址
[AR3]interface GigabitEthernet 0/0/1 //切换接口
[AR3-GigabitEthernet0/0/1]ip address 192.168.23.3 255.255.255.0 /配置IP地址
[AR3]ospf 1 router-id 3.3.3.3 /给ospf 1 配置个名字为3