一、要求
通过实现ospf协议,实现pc1和pc2的互通
1.配置ospf的router id:设备为R1,则router id 为1.0.0.1
2.0.0.2
2.按照要求配置ospf的协议,进程号为100
3.配置OSPF区域0的认证,认证方式为明文认证,密码为HW@123
4.在R1和R2时间配置接口认证,认证方式为明文认证,密码为BS@123
5.配置R1、R2的hello timer为20s ,dead timer 为90s
6.要求R1接受到192.168.2.0的路由的开销值为5
7.配置R1与R2之间,R1为DR,优先值为120
二、配置
1.2.
[r1]ospf 100 router-id 1.0.0.1
[r2]ospf 100 router-id 2.0.0.2
3.配置区域认证
[r1]ospf 100
[r1-ospf-100]area 0
[r1-ospf-100-area-0.0.0.0]authentication-mode simple hw@123
[r1-ospf-100-area-0.0.0.0]q
[r1-ospf-100]disp this //查看区域认证配置
#
ospf 100 router-id 1.0.0.1
area 0.0.0.0
authentication-mode simple plain hw@123
network 192.168.1.0 0.0.0.255
network 12.1.0.0 0.0.0.255
#
return
[r1-ospf-100]
[r2]ospf 100
[r2-ospf-100]area 0
[r2-ospf-100-area-0.0.0.0]authentication-mode simple hw@123
[r2-ospf-100-area-0.0.0.0]q
[r2-ospf-100]disp this //查看区域认证配置
#
ospf 100 router-id 2.0.0.2
area 0.0.0.0
authentication-mode simple plain hw@123
network 192.168.2.0 0.0.0.255
network 12.1.0.0 0.0.0.255
#
return
[r2-ospf-100]q
4.配置接口认证
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ospf authentication-mode simple BS@123
[r1-GigabitEthernet0/0/1]display this //查看接口配置
#
interface GigabitEthernet0/0/1
ip address 12.1.1.1 255.255.255.0
ospf authentication-mode simple plain BS@123
#
return
[r1-GigabitEthernet0/0/1]
[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]ospf authentication-mode simple BS@123
[r2-GigabitEthernet0/0/1]display this //查看接口配置
#
interface GigabitEthernet0/0/1
ip address 12.1.1.2 255.255.255.0
ospf authentication-mode simple plain BS@123
#
return
[r2-GigabitEthernet0/0/1]
5.修改hello时间和dead时间
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ospf timer hello 20
[r1-GigabitEthernet0/0/1]ospf timer dead 90 //dead时间是hello时间的4倍
[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]ospf timer hello 20
[r2-GigabitEthernet0/0/1]ospf timer dead 90 //dead时间是hello时间的4倍
6.路由开销值配置
[r2]int g0/0/2
[r2-GigabitEthernet0/0/2]ospf cost 4
7.修改DR优先级值
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ospf dr-priority 120
<r1>reset ospf process
[r1]display ospf peer brief //查看