admin 发表于 2021-2-5 23:07:20

华为OSPF基本配置

华为OSPF基本配置

OSFP协议路由角色分为:IR 内部路由 即所有接口都在同一区域内ABR区域边界路由 连接不同区域之间的路由ASBR自治系统边界路由 即连接OSPF协议及其它轮协议间路由DR 指定路由BDR备份指定路由DRother其它/非指定路由 区域一般分为两个层级:AREA0 骨干区域AREA大于0数值非骨干区域
基本配置为:R1<Huawei>system-viewsysnamer1interfaceGigabitEthernet 0/0/0ipaddress 192.168.12.1 24quitrouterid 1.1.1.1interfaceloopback 0ipaddress 1.1.1.1 24quitospf1//打开OSPF协议 进程为1 area1//创建非骨干区域 1authentication-modemd5 1 cipher admin1234//配置认证模式及密码network1.1.1.1 0.0.0.0//宣告参考网络 注意通配符network192.168.12.0 0.0.0.255quitquitdisplayospf brief
R2<Huawei>system-viewsysnamer2interfaceGigabitEthernet 0/0/0ipaddress 192.168.12.2 24quitinterfaceGigabitEthernet 0/0/1ipaddress 192.168.23.2 24quitrouterid 2.2.2.2interfaceloopback 0ipaddress 2.2.2.2 32quitospf1area1authentication-modemd5 1 cipher admin1234network2.2.2.2 0.0.0.0network192.168.12.0 0.0.0.255quitarea0authentication-modemd5 1 cipher admin1234network192.168.23.0 0.0.0.255return
R3<Huawei>system-viewsysnamer3interfaceGigabitEthernet 0/0/0ipaddress 192.168.23.3 24quitinterfaceGigabitEthernet 0/0/1ipaddress 192.168.34.3 24quitrouterid 3.3.3.3interfaceloopback 0ipaddress 3.3.3.3 32quitospf1area0authentication-modemd5 1 cipher admin1234network192.168.23.0 0.0.0.255quitarea2authentication-modemd5 1 cipher admin1234network3.3.3.3 0.0.0.0network192.168.34.0 0.0.0.255return
R4<Huawei>system-viewsysnamer4interfaceGigabitEthernet 0/0/0ipaddress 192.168.34.4 24quitrouterid 4.4.4.4interfaceloopback 0ipaddress 4.4.4.4 32quitospf1area2authentication-modemd5 1 cipher admin1234network4.4.4.4 0.0.0.0network192.168.34.0 0.0.0.255return
检验displayip routing-table//显示IP路由表结果显示R1中已经学习到了所有OSFP自治区域中的网段。其它省略。检验R2的OSPF邻居状态:displayospf peer
邻居为R3和R1再显示OSPF的链路状态数据库(LSDB)信息display ospf lsdb
最后Ping测试各路由连通状态:ping2.2.2.2PING2.2.2.2: 56data bytes, press CTRL_C tobreak   Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=50 ms   Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=255 time=20 ms   Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=255 time=20 ms   Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=255 time=20 ms   Reply from 2.2.2.2: bytes=56 Sequence=5 ttl=255 time=30 ms ---2.2.2.2 ping statistics ---    5packet(s) transmitted    5packet(s) received   0.00% packet loss   round-trip min/avg/max = 20/28/50 ms ping3.3.3.3PING3.3.3.3: 56data bytes, press CTRL_C tobreak   Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=254 time=50 ms   Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=254 time=30 ms   Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=254 time=30 ms    Replyfrom 3.3.3.3: bytes=56 Sequence=4 ttl=254 time=40 ms   Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=254 time=20 ms ---3.3.3.3 ping statistics ---    5packet(s) transmitted    5packet(s) received   0.00% packet loss   round-trip min/avg/max = 20/34/50 ms ping4.4.4.4PING4.4.4.4: 56data bytes, press CTRL_C tobreak   Reply from 4.4.4.4: bytes=56 Sequence=1 ttl=253 time=60 ms   Reply from 4.4.4.4: bytes=56 Sequence=2 ttl=253 time=40 ms   Reply from 4.4.4.4: bytes=56 Sequence=3 ttl=253 time=50 ms   Reply from 4.4.4.4: bytes=56 Sequence=4 ttl=253 time=40 ms   Reply from 4.4.4.4: bytes=56 Sequence=5 ttl=253 time=30 ms ---4.4.4.4 ping statistics ---    5packet(s) transmitted    5packet(s) received   0.00% packet loss   round-trip min/avg/max = 30/44/60 ms
页: [1]
查看完整版本: 华为OSPF基本配置

公司网站