数通 | 多区域OSPF动态路由协议的配置

OSPF协议简介

开放式最短路径优先OSPF(Open Shortest Path First)是IETF组织开发的一个基于链路状态的内部网关协议(Interior Gateway Protocol)。OSPF分为OSPFv2和OSPFv3两个版本,其中OSPFv2用在IPv4网络,OSPFv3用在IPv6网络。

主要要了解OSPF的三张表:

  • 邻居表(Peer table)
    OSPF是一种可靠的路由协议,要求在路由器之间传递链路状态通告之前,需先建立OSPF邻居关系,hello报文用于发现直连链路上的其他OSPF路由器,再经过一系列的OSPF消息交互最终建立起全毗邻的邻居关系,OSPF路由器的邻居信息显示在邻居表中。

  • 链路状态数据库(Link-state database,简称LSDB)
    OSPF用LSA(link state Advertisement,链路状态通告)来描述网络拓扑信息,然后OSPF路由器用LSDB来存储网络的这些LSA。OSPF将自己产生的以及邻居通告的LSA搜集并存储在LSDB中。掌握LSDB的查看以及对LSA的深入分析才能够深入理解OSPF。

  • OSPF路由表(Routing table)
    基于LSDB进行SPF(Dijkstra算法)计算,而得出的OSPF路由表。

拓扑图(含IP规划)

  • 配置任务
    按照拓扑图要求配置IP地址,配置多区域OSPF动态路由协议,最终实现PC1和PC2的互相通信。

  • 配置工具
    华为网络设备仿真平台eNSP

配置多区域OSPF动态路由协议

配置步骤(含完整指令)

首先,配置主机PC1、PC2的IP信息很简单(留意网关就好),比如PC1就这样:
配置主机PC1

然后,需要配置的是R1、R2、R3、R4的各个端口所分配的IP地址,以R1为例,需要配置的有Eth0/0/0(10.1.1.2/30)、Eth0/0/1(10.1.4.1/30)、G0/0/0(10.1.3.1/30)这三个端口。

<Huawei>sys  # R1
Enter system view, return user view with Ctrl+Z.
[Huawei]int eth0/0/0
[Huawei-Ethernet0/0/0]ip address 10.1.1.2 30
[Huawei-Ethernet0/0/0]
Jul 25 2019 20:13:20-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface Ethernet0/0/0 has entered the UP state.
Jul 25 2019 20:13:24-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 1, the change loop count is 0, and the maximum number of records is 4095.
[Huawei-Ethernet0/0/0]int eth0/0/1
[Huawei-Ethernet0/0/1]ip address 10.1.4.1 30
[Huawei-Ethernet0/0/1]
Jul 25 2019 20:13:47-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface Ethernet0/0/1 has entered the UP state.
Jul 25 2019 20:13:54-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 2, the change loop count is 0, and the maximum number of records is 4095.
[Huawei-Ethernet0/0/1]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 10.1.3.1 30
[Huawei-GigabitEthernet0/0/0]
Jul 25 2019 20:14:12-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state.
Jul 25 2019 20:14:14-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 3, the change loop count is 0, and the maximum number of records is 4095.
[Huawei-GigabitEthernet0/0/0]q
[Huawei]

<Huawei>sys  # R1
Enter system view, return user view with Ctrl+Z.
[Huawei]int eth0/0/0
[Huawei-Ethernet0/0/0]ip address 10.1.2.2 30
[Huawei-Ethernet0/0/0]
Jul 25 2019 20:16:05-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface Ethernet0/0/0 has entered the UP state.
Jul 25 2019 20:16:13-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 1, the change loop count is 0, and the maximum number of records is 4095.
[Huawei-Ethernet0/0/0]int eth0/0/1
[Huawei-Ethernet0/0/1]ip address 10.1.5.1 30
[Huawei-Ethernet0/0/1]
Jul 25 2019 20:16:39-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface Ethernet0/0/1 has entered the UP state.
Jul 25 2019 20:16:43-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 2, the change loop count is 0, and the maximum number of records is 4095.
[Huawei-Ethernet0/0/1]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 10.1.3.2 30
[Huawei-GigabitEthernet0/0/0]
Jul 25 2019 20:16:59-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state.
Jul 25 2019 20:17:03-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 3, the change loop count is 0, and the maximum number of records is 4095.
[Huawei-GigabitEthernet0/0/0]q
[Huawei]

<Huawei>sys  #R3
Enter system view, return user view with Ctrl+Z.
[Huawei]int eth0/0/0
[Huawei-Ethernet0/0/0]ip address 10.1.1.1 30
[Huawei-Ethernet0/0/0]
Jul 25 2019 20:18:56-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface Ethernet0/0/0 has entered the UP state.
Jul 25 2019 20:19:03-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 1, the change loop count is 0, and the maximum number of records is 4095.
[Huawei-Ethernet0/0/0]int eth0/0/1
[Huawei-Ethernet0/0/1]ip address 10.1.2.1 30
[Huawei-Ethernet0/0/1]
Jul 25 2019 20:19:22-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface Ethernet0/0/1 has entered the UP state.
Jul 25 2019 20:19:23-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 c
  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值