[华为动态路由-ospf] 动态路由OSPF协议配置

0x0 ospf的配置

在这里插入图片描述

 **AR1:**
 ospf 100   #创建ospf协议进程号
 area 0      #进入区域
 network 12.1.1.0 0.0.0.255  #ospf宣告直连网段的掩码是反掩码

**AR2:**
ospf 100     #创建ospf协议进程号
area 0        #进入区域
network 12.1.1.0 0.0.0.255    #ospf宣告直连网段的掩码是反掩码
network 23.1.1.0 0.0.0.255    #ospf宣告直连网段的掩码是反掩码

**AR3:**
ospf 100    #创建ospf协议进程号
area 0       #进入区域
network 23.1.1.0 0.0.0.255    #ospf宣告直连网段的掩码是反掩码

查看ospf配置:

display ospf peer               #查看ospf邻居
display ip routing-table protocol ospf  #查看ospf协议的路由表

0x1 ospf 修改RID

1.#查看ospf配置信息
[Huawei]dis ospf peer

 OSPF Process 100 with Router ID 12.1.1.1
	 Neighbors 

2.#修改router-id

[Huawei]ospf 100 router-id 1.1.1.1
Info: The configuration succeeded. You need to restart the OSPF process 
to validate the new router ID.

#RID ID 不需要是设备上真实存在的IP

3.重置ospf进程

 <Huawei>reset ospf process
    Warning: The OSPF process will be reset. Continue? [Y/N]:y

修改后:

<Huawei>dis ospf peer

	 OSPF Process 100 with Router ID 1.1.1.1
		 Neighbors 

0x2 修改ospf 基准带宽

[Huawei-ospf-100]bandwidth-reference 1000

建议在线路大于百M的时候就修改ospf的基准带宽,把基准带宽修改成网络中最大带宽(默认是百兆)

10000/1000=10
10+10=20 cost

0x3 设置静默接口

在数据转发给下一个设备的接口上配置静默接口,就无法转发OSPF数据包
ospf 100
silent-interface g0/0/1

注:

RIP协议的静默接口是阻断广播和组播,不能阻断单播 OSPF协议的静默接口是阻断所有传播

0x4 修改计时器

进入接口
[R1-GigabitEthernet 0/0/0] ospf timer hello 20 //默认时间为10s

[R1-GigabitEthernet 0/0/0] ospf timer dead 60

注:邻居双方hello时间和死亡时间要一致,所以邻居之间都需要修改

修改DR 和BDR角色

[R1-GigabitEthernet 0/0/0] ospf dr-priority 10

需要把原本的DR 的优先级改成0,其他的DR才能被选举

OSPF 认证

接口认证: [R1-GigabitEthernet 0/0/0] ospf authentication-mode md5 1 cipher
huawei111 //密文认证

区域认证:
ospf 100
area 0
ospf authentication-mode md5 1 cipher huawei1

发布了39 篇原创文章 · 获赞 30 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/weixin_42728126/article/details/86942967