首页 > 其他分享 >华为路由器 OSPF单区域配置

华为路由器 OSPF单区域配置

时间:2023-01-24 19:06:21浏览次数:49  
标签:ospf 0.0 GigabitEthernet0 192.168 R1 华为 2.2 OSPF 路由器


拓扑图

华为路由器 OSPF单区域配置_网络

一、R1 路由器

<Huawei> sys
[Huawei]sys R1
[R1]un in en
[R1]dhcp enable
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip addr 192.168.20.2 24

# 配置DHCP
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip addr 192.168.10.1 24
[R1-GigabitEthernet0/0/1]dhcp select int
[R1-GigabitEthernet0/0/1]quit

# 配置OSPF
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 192.168.10.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 192.168.20.0 0.0.0.255

二、R2 路由器

[Huawei]sys R2
[R2]un in en
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip addr 192.168.30.1 24
[R2-GigabitEthernet0/0/1]int g0/0/0
[R2-GigabitEthernet0/0/0]ip addr 192.168.20.1 24
[R2-GigabitEthernet0/0/0]quit

# 配置OSPF
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 192.168.20.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 192.168.30.0 0.0.0.255

三、R3 路由器

[Huawei]sys R3
[R3]un in en
[R3]dhcp enable
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip addr 192.168.30.2 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip addr 192.168.40.1 24
[R3-GigabitEthernet0/0/1]dhcp select int
[R3-GigabitEthernet0/0/1]quit

# 配置OSPF
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 192.168.30.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 192.168.40.0 0.0.0.255

四、验证

1、R1 查看邻居表

# 只有 2.2.2.2 一个邻居ID
[R1]dis ospf peer

OSPF Process 1 with Router ID 1.1.1.1
Neighbors

Area 0.0.0.0 interface 192.168.20.2(GigabitEthernet0/0/0)'s neighbors
Router ID: 2.2.2.2 Address: 192.168.20.1
State: Full Mode:Nbr is Master Priority: 1
DR: 192.168.20.1 BDR: 192.168.20.2 MTU: 0
Dead timer due in 37 sec
Retrans timer interval: 5
Neighbor is up for 00:13:35
Authentication Sequence: [ 0 ]

[R1]dis ospf peer brief

OSPF Process 1 with Router ID 1.1.1.1
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 GigabitEthernet0/0/0 2.2.2.2 Full
----------------------------------------------------------------------------

2、R2 查看邻居表

# 可以看到有 3.3.3.3,1.1.1.1 2个邻居
[R2]dis ospf peer

OSPF Process 1 with Router ID 2.2.2.2
Neighbors

Area 0.0.0.0 interface 192.168.30.1(GigabitEthernet0/0/1)'s neighbors
Router ID: 3.3.3.3 Address: 192.168.30.2
State: Full Mode:Nbr is Master Priority: 1
DR: 192.168.30.2 BDR: 192.168.30.1 MTU: 0
Dead timer due in 32 sec
Retrans timer interval: 5
Neighbor is up for 00:15:27
Authentication Sequence: [ 0 ]

Neighbors

Area 0.0.0.0 interface 192.168.20.1(GigabitEthernet0/0/0)'s neighbors
Router ID: 1.1.1.1 Address: 192.168.20.2
State: Full Mode:Nbr is Slave Priority: 1
DR: 192.168.20.1 BDR: 192.168.20.2 MTU: 0
Dead timer due in 37 sec
Retrans timer interval: 5
Neighbor is up for 00:15:35
Authentication Sequence: [ 0 ]


[R2]dis ospf peer brief

OSPF Process 1 with Router ID 2.2.2.2
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 GigabitEthernet0/0/1 3.3.3.3 Full
0.0.0.0 GigabitEthernet0/0/0 1.1.1.1 Full
----------------------------------------------------------------------------
[R2]dis ospf peer brief

OSPF Process 1 with Router ID 2.2.2.2
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 GigabitEthernet0/0/1 3.3.3.3 Full
0.0.0.0 GigabitEthernet0/0/0 1.1.1.1 Full
----------------------------------------------------------------------------

3、R3 查看邻居表

# 只有一个 2.2.2.2 邻居
<R3>dis ospf peer

OSPF Process 1 with Router ID 3.3.3.3
Neighbors

Area 0.0.0.0 interface 192.168.30.2(GigabitEthernet0/0/0)'s neighbors
Router ID: 2.2.2.2 Address: 192.168.30.1
State: Full Mode:Nbr is Slave Priority: 1
DR: 192.168.30.2 BDR: 192.168.30.1 MTU: 0
Dead timer due in 33 sec
Retrans timer interval: 5
Neighbor is up for 00:17:49
Authentication Sequence: [ 0 ]


[R3]dis ospf peer brief

OSPF Process 1 with Router ID 3.3.3.3
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 GigabitEthernet0/0/0 2.2.2.2 Full
----------------------------------------------------------------------------

五、验证互通

# 成功
PC1>ping 192.168.40.254

Ping 192.168.40.254: 32 data bytes, Press Ctrl_C to break
From 192.168.40.254: bytes=32 seq=1 ttl=125 time=15 ms
From 192.168.40.254: bytes=32 seq=2 ttl=125 time=32 ms
From 192.168.40.254: bytes=32 seq=3 ttl=125 time=31 ms
From 192.168.40.254: bytes=32 seq=4 ttl=125 time=31 ms
From 192.168.40.254: bytes=32 seq=5 ttl=125 time=16 ms

--- 192.168.40.254 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 15/25/32 ms

标签:ospf,0.0,GigabitEthernet0,192.168,R1,华为,2.2,OSPF,路由器
From: https://blog.51cto.com/mshxuyi/6022292

相关文章

  • 华为交换机 VLAN中 access跟trunk原理
    access接口(用于连接主机)工作原理:1、收到数据帧时:        收到一个不含VLANID的数据包,将该数据包打上Access的PVID        收到一个含VLANID的数据包  ......
  • “任性”华为 | 七十八岁老人的“四渡赤水”(二)
    导读华为是一家“任性”的企业——因为任正非将自己的性格赋予了华为——在企业前进的每一个路口,都会看见这种性格的印记。2022年12月,当美国总统拜登出现在凤凰城出席台积电......
  • 从路由器真机提取固件包(一)
    前言看IOT也有一段时间了,但是一直都是从官网获取固件包,没有尝试过从真机里提取固件。在看了一些师傅的文章后决定尝试一下从真机中提取固件。正好手里也有几个路由器,于是......
  • Openwrt路由器搭建网站教程
      最近都在折腾这个,多方借鉴了一下,萌新一枚,分享一下过程,不足之处,还请大佬指点指点本文主要内容:1.安装Entware2.安装ONMP3.安装可道云网站程序准备材料:1......
  • 华为VR Glass连接电脑
    硬件准备:电脑(配置需要合格,当然越高越好,显卡要给力,vr眼镜的分辨率是3200x1600)华为VRglass一个(这里我用的华为VRGlassCV10)noloVR套件(这是配合华为vr的......
  • OSPF理论
    一,OSPF基础1.1基础术语1.OSPF基于IP协议封装,SPF算法的链路状态路由协议OSPF(OpenShortestPathFirest),内部网关协议,协议号89。通过交互LSA(LinkStateAdvertisement......
  • 华为面试题之购物单解答
    原题如下:题目描述王强今天很开心,公司发给N元的年终奖。王强决定把年终奖用于购物,他把想买的物品分为两类:主件与附件,附件是从属于某个主件的,下表就是一些主件与附件的例子: ......
  • 揭开华为云CodeArts TestPlan启发式测试设计神秘面纱!​
    ​2019年12月20日,是美国波音公司新一代载人飞船Starliner“星际客机”,执行第一次飞行测试任务的重要日。按计划飞船在本次无人试飞中将与国际空间站对接,为宇航员送上圣诞礼......
  • 华为云发布CodeArts Req需求管理工具,让需求管理化繁为简​
    ​近期,华为云正式发布CodeArtsReq,这是一款自主研发的软件研发管理与团队协作工具,凝结了华为30多年软件研发的先进理念与丰富实践,具有强大的组织协作能力,旨在助力企业大规模......
  • 华为云服务治理 — 隔离仓的作用
      服务治理通常是指通过限流、熔断等手段,保障微服务的可靠运行,即运行时治理。更加宽泛的服务治理还包括微服务持续集成(开源软件管理、自动化测试等),微服务部署最佳实践(滚动......