實驗要求:掌握OSPF基於端口認證方式spa
拓撲以下router
簡單認證blog
R1ip
enable 進入特權模式md5
config 進入全局模式同步
hostname R1 修更名稱it
interface s0/1 進入端口io
ip aadress 192.168.1.1 255.255.255.0 設置IP地址class
physical-layer speed 64000 設置同步時鐘route
interface l0 進入端口
ip address 192.168.2.254 255.255.255.0 設置IP地址
exit 返回上一級
router ospf 1 啓動OSPF協議
network 192.168.1.0 255.255.255.0 area 0 添加直連網段到OSPF
network 192.168.2.0 255.255.255.0 area 0 添加直連網段到OSPF
interface s0/1 進入端口
ip ospf authentication simple 啓動OSPF端口簡單認證
ip ospf password 978285 設置簡單認證密碼
R2
enable 進入特權模式
config 進入全局模式
hostname R1 修更名稱
interface s0/1 進入端口
ip aadress 192.168.1.2 255.255.255.0 設置IP地址
physical-layer speed 64000 設置同步時鐘
interface l0 進入端口
ip address 192.168.3.254 255.255.255.0 設置IP地址
exit 返回上一級
router ospf 1 啓動OSPF協議
network 192.168.1.0 255.255.255.0 area 0 添加直連網段到OSPF
network 192.168.3.0 255.255.255.0 area 0 添加直連網段到OSPF
interface s0/1 進入端口
ip ospf authentication simple 啓動OSPF端口簡單認證
ip ospf password 978285 設置簡單認證密碼
MD5認證
R1
enable 進入特權模式
config 進入全局模式
hostname R1 修更名稱
interface s0/1 進入端口
ip aadress 192.168.1.1 255.255.255.0 設置IP地址
physical-layer speed 64000 設置同步時鐘
interface l0 進入端口
ip address 192.168.2.254 255.255.255.0 設置IP地址
exit 返回上一級
router ospf 1 啓動OSPF協議
network 192.168.1.0 255.255.255.0 area 0 添加直連網段到OSPF
network 192.168.2.0 255.255.255.0 area 0 添加直連網段到OSPF
interface s0/1 進入端口
ip ospf authentication message-digest 啓動OSPF端口MD5認證
ip ospf message-digest-key 1 md5 978285 設置MD5認證密碼
R2
enable 進入特權模式
config 進入全局模式
hostname R1 修更名稱
interface s0/1 進入端口
ip aadress 192.168.1.1 255.255.255.0 設置IP地址
physical-layer speed 64000 設置同步時鐘
interface l0 進入端口
ip address 192.168.3.254 255.255.255.0 設置IP地址
exit 返回上一級
router ospf 1 啓動OSPF協議
network 192.168.1.0 255.255.255.0 area 0 添加直連網段到OSPF
network 192.168.3.0 255.255.255.0 area 0 添加直連網段到OSPF
interface s0/1 進入端口
ip ospf authentication message-digest 啓動OSPF端口MD5認證
ip ospf message-digest-key 1 md5 978285 設置MD5認證密碼
相關命令
基於端口的簡單認證
ip ospf authentication simple 在相應端口啓動簡單認證
ip ospf password [密碼] 在相應端口設置認證密碼
基於端口的MD5認證
ip ospf authentication message-digest 在相應端口啓動認證
ip ospf message-digest-key [keyID] md5 [密碼] 在相應端口設置keyID以及認證密碼