<Huawei>system-view //进入系统视图
[Huawei]sysname R1 //更改设备名称
[R1]interface gi 0/0/0 //进入端口
[R1-GigabitEthernet0/0/0]ip address 192.168.12.1 255.255.255.0//设置IP地址
[R1-GigabitEthernet0/0/0]undo shutdown //激活
[R1]interface LoopBack 0 //进入回环链路
[R1-LoopBack0]ip add 10.10.1.1 255.255.255.0 //设置回环IP地址
[R1-LoopBack0]q //退出
[R1]ospf //进入ospf 默认是1
[R1-ospf-1]area 0 //创建ospf骨干区域0
[R1-ospf-1-area-0.0.0.0]network 192.168.12.1 0.0.0.0 //宣告精准ospf地址
[R1-ospf-1-area-0.0.0.0]network 10.10.1.1 0.0.0.0 //宣告精准ospf地址
<Huawei>system-view
[Huawei]sysname R2
[R2]interface gi 0/0/1 [R2-GigabitEthernet0/0/1]ip add 192.168.12.2 255.255.255.0
[R2-GigabitEthernet0/0/1]undo shutdown
[R2-GigabitEthernet0/0/1]interface gi 0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.23.1 255.255.255.0
[R2-GigabitEthernet0/0/0]undo shutdown
[R2]interface LoopBack 0
[R2-LoopBack0]ip add 10.10.2.2 255.255.255.0
[R2-LoopBack0]q
[R2]ospf
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 192.168.12.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.10.2.2 0.0.0.0
[R2-ospf-1]area 1 //创建非骨干区域1
[R2-ospf-1-area-0.0.0.1]network 192.168.23.1 0.0.0.0 //宣告边界回环链路IP地址
<Huawei>system-view
[Huawei]sysname R3
[R3]interface gi0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.23.2 255.255.255.0
[R3-GigabitEthernet0/0/1]undo shutdown
[R3-GigabitEthernet0/0/1]interface gi0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.34.1 255.255.255.0
[R3-GigabitEthernet0/0/0]undo shutdown
[R3]interface LoopBack 0
[R3-LoopBack0]ip add 10.10.3.3 255.255.255.0
[R3-LoopBack0]q
[R3]ospf
[R3-ospf-1]area 1 //创建非骨干区域1
[R3-ospf-1-area-0.0.0.1]network 192.168.23.2 0.0.0.0
[R3-ospf-1-area-0.0.0.1]network 192.168.34.1 0.0.0.0
[R3-ospf-1-area-0.0.0.1]network 10.10.3.3 0.0.0.0
<Huawei>system-view
[Huawei]sysname R4
[R4]interface gi0/0/1
[R4-GigabitEthernet0/0/1]ip add 192.168.34.2 255.255.255.0
[R4-GigabitEthernet0/0/1]undo shutdown
[R4]interface LoopBack 0
[R4-LoopBack0]ip add 10.10.4.4 255.255.255.0
[R4-LoopBack0]q
[R4]ospf
[R4-ospf-1]area 1 //创建非骨干区域1
[R4-ospf-1-area-0.0.0.1]network 192.168.34.2 0.0.0.0
[R4-ospf-1-area-0.0.0.1]network 10.10.4.4 0.0.0.0
[R4-ospf-1-area-0.0.0.1]
(1)配置四台路由器的物理接口IP地址
(2)配置每台路由器的回环IP地址interface loopback 0
(3)R1,R2创建ospf骨干区域area 0 ,R3 R4创建非骨干区域area 1,并宣告精准 ospf链路(物理IP和回环IP地址)
(4)R2创建骨干区域area 0和非骨干区域area 1并精准宣告地址
(5)ping命令验证是否全网互通
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。