良许Linux教程网 干货合集 配置OSPF单区域

配置OSPF单区域

OSPf,是一个路由协议,路由协议的作用就是让路由器之前能够动态的共享网络信息,使其能够获得远程网络。

区域的概念是OSPF特有的一种属性,因为OSPF在运行时有一个操作叫做LSA泛洪,泛洪会占用网络很大的带宽,同时消耗路由器的资源,严重的影响可能会导致路由器down机。为了减小这种影响,其中一种方式就是减小参与泛洪的路由器的数量,于是将网络中运行OSPF的路由器逻辑的划分为几个区域,泛洪的操作只在区域中进行,路由器减少了,同样就是减小了泛洪的影响。当网络中的路由器数量较少的时候,我们可以不对其进行区域划分,让其只运行在一个区域中,即 area 0,就是单区域路由了。当路由器数量较大的时候,就得进行区域的划分,划分之后就是多区域路由,但不管在什么时候 area 0 必须存在,其他区域必须与area 0 相连。

配置OSPF单区域 实验环境:红,绿,蓝三个颜色区域代表三个不同网络的办公场所,要求使用OSPF协议实现网络互通。

pc1:172.16.1.1

pc2:172.16.2.1

pc3:172.16.3.1

R1:GE0/0/0 172.16.1.254 GE2/0/0 192.168.2.1 GE0/0/1 192.168.1.1

R2:GE0/0/0 172.16.2.254 GE0/0/1 192.168.2.3 GE2/0/0 192.168.2.3

R3:GE0/0/0 172.16.3.254 GE0/0/1 192.168.1.3 GE2/0/0 192.168.3.3

配置PC ip地址

OSPF单区域配置OSPF单区域配置
OSPF单区域配置OSPF单区域配置
OSPF单区域配置OSPF单区域配置

配置路由器

R1:

[R1]INT GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]IP ADD 172.16.1.254 24
May 21 2020 10:38:30-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R1-GigabitEthernet0/0/0]INT G2/0/0
[R1-GigabitEthernet2/0/0]IP ADD 192.168.2.1 24
May 21 2020 10:38:48-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet2/0/0 has entered the UP state.
[R1-GigabitEthernet2/0/0]INT G0/0/1
[R1-GigabitEthernet0/0/1]IP ADD 192.168.1.1 24
[R1-GigabitEthernet0/0/1]
May 21 2020 10:39:03-08:00 R1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.

R2:

[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 192.168.2.2 24
May 21 2020 10:40:28-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R2-GigabitEthernet0/0/1]int g2/0/0
[R2-GigabitEthernet2/0/0]ip add 192.168.3.2 24
May 21 2020 10:40:39-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet2/0/0 has entered the UP state.
[R2-GigabitEthernet2/0/0]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 172.16.2.254 24
May 21 2020 10:40:57-08:00 R2 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.

R3:

[R3]int GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip add 172.16.3.254 24
May 21 2020 10:42:11-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.1.3 24
May 21 2020 10:42:21-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R3-GigabitEthernet0/0/1]int g2/0/0
[R3-GigabitEthernet2/0/0]ip add 192.168.3.3 24
May 21 2020 10:42:51-08:00 R3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet2/0/0 has entered the UP state.
[R3-GigabitEthernet2/0/0]

配置OSPF

R1:

[R1]OSPF 1
[R1-ospf-1]AREA 0
[R1-ospf-1-area-0.0.0.0]NETWORK 172.16.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]NETWORK 192.168.2.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]NETWORK 192.168.1.0 0.0.0.255

R2:

[R2]OSPF 1
[R2-ospf-1]AREA 0
[R2-ospf-1-area-0.0.0.0]NETWO
[R2-ospf-1-area-0.0.0.0]network 172.16.2.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]NETWORK 192.168.2.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]NETWORK 192.168.3.0 0.0.0.255

R3:

[R3]OSPF 1
[R3-ospf-1]AREA 0
[R3-ospf-1-area-0.0.0.0]NETWORK 172.16.3.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]NETWORK 192.168.1.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]NETWORK 192.168.3.0 0.0.0.255

测试pc1 ping pc2,pc3

OSPF单区域配置OSPF单区域配置 如此,OSPF配置完毕!

以上就是良许教程网为各位朋友分享的Linu系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你 !

img
本文由 良许Linux教程网 发布,可自由转载、引用,但需署名作者且注明文章出处。如转载至微信公众号,请在文末添加作者公众号二维码。
良许

作者: 良许

良许,世界500强企业Linux开发工程师,公众号【良许Linux】的作者,全网拥有超30W粉丝。个人标签:创业者,CSDN学院讲师,副业达人,流量玩家,摄影爱好者。
上一篇
下一篇

发表评论

联系我们

联系我们

公众号:良许Linux

在线咨询: QQ交谈

邮箱: yychuyu@163.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部