拓扑图如下:
条件:
4台路由 AR1220
========================================================
AR-1配置:
<Huawei>system-view //进系统视图
[Huawei]sysname AR-1 //修改主机名
[AR-1]int g0/0/0 //进接口g0/0/0
[AR-1-GigabitEthernet0/0/0]ip address 192.168.14.1 24 //配置IP地址和子网掩码
[AR-1-GigabitEthernet0/0/0]int g0/0/1 //切换接口
[AR-1-GigabitEthernet0/0/0]ip address 192.168.14.1 24 //配置IP地址和子网掩码
启动OSPF如下命令:
[AR-1]ospf 1 router-id 1.1.1.1 //名称为1
[AR-1-ospf-1]area 0 //进入骨干区域0
[AR-1-ospf-1-area-0.0.0.0]network 192.168.14.0 0.0.0.255 //配置IP地址和反掩码
[AR-1-ospf-1-area-0.0.0.0]q //退到上一层
[AR-1-ospf-1]area 0.0.0.1 //进入非骨干区域0.0.0.1
[AR-1-ospf-1-area-0.0.0.1]network 192.168.12.0 0.0.0.255 //配置IP地址和反掩码
================================================================================================
AR-2配置:
<Huawei>system-view //进系统视图
[Huawei]sysname AR-2 //修改主机名
[AR-2]int g0/0/0 //进g0/0/0接口
[AR-2-GigabitEthernet0/0/0]ip address 1