![图片[1]-2.5 OSPF 报文认证-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片8-24-1024x242.png)
1.接口认证
[R2-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher dsrw.com
[R3-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher dsrw.com
![图片[2]-2.5 OSPF 报文认证-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片9-23-1024x452.png)
2.区域认证(区域0所有设备都必须配置)
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher dsrw.com
[R4]ospf 1
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher dsrw.com
![图片[3]-2.5 OSPF 报文认证-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片11-22-1024x485.png)
3.虚电路认证
1)R1配置OSPF
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
2)R2配置OSPF
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]network 23.1.1.0 0.255.255.255
3)R3配置OSPF
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.1]network 23.1.1.0 0.255.255.255
[R3-ospf-1-area-0.0.0.1]quit
[R3-ospf-1]area 2
[R3-ospf-1-area-0.0.0.2]network 34.1.1.0 0.255.255.255
4)R4配置OSPF
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 2
[R4-ospf-1-area-0.0.0.2]network 4.4.4.4 0.0.0.0
[R4-ospf-1-area-0.0.0.2]network 34.1.1.0 0.255.255.255
5)区域1配置虚电路及认证
![图片[4]-2.5 OSPF 报文认证-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片12-21-1024x329.png)
[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]vlink-peer 3.3.3.3 hmac-md5 1 cipher dsrw.com
[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]vlink-peer 2.2.2.2 hmac-md5 1 cipher dsrw.com
[R2]display ospf vlink
OSPF Process 1 with Router ID 2.2.2.2
Virtual Links
Virtual-link Neighbor-id -> 3.3.3.3, Neighbor-State: Full
Interface: 23.1.1.2 (GigabitEthernet0/0/1)
Cost: 1 State: P-2-P Type: Virtual
Transit Area: 0.0.0.1
Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1
GR State: Normal
6)区域0做区域认证
(R3作为虚链路的端点,R3也要开启area0区域认证,否则虚链路无法正常建立),当同时出现区域认证和V-Link认证时,V-Link认证优先。
[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher dsrw.com
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher dsrw.com
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher dsrw.com
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后查看评论内容