OSPF認證 ospf認證解決安全隱患,只要經過認證的ospf路由器才能正常創建鄰居關係、交互信息 認證模式:不認證null(默認);明文simple認證;MD5認證 OSPF的認證方式 ** 接口認證** [R1-GigabitEthernet0/0/2]ospf authentication-mode simple cipher 123 //進入配置進程的接口配置認證方式爲明文 密碼123 cipher加密僅表示在查看命令時加密顯示,而報文在傳輸過程當中密碼是明文顯示。 [R1-GigabitEthernet0/0/2] ospf authentication-mode md5 1 cipher 123 // MD5認證,1爲key id,密碼爲123,cipher表示報文在傳輸過程當中經過MD5算法加密 **區域認證** Ospf area 0 authentication-mode simple cipher 123 明文認證,密碼爲123, cipher加密僅表示在查看命令時加密顯示,而報文在傳輸過程當中密碼是明文顯示。 authentication-mode md5 1 cipher 123 MD5認證,1爲key id,密碼爲123,cipher表示報文在傳輸過程當中經過MD5算法加密 注意:當simple和MD5都存在時,優先使用接口認證方式 兩臺設備之間 要麼兩端都不配置認證 要麼兩端都都配置simple認證 要麼兩端都都配置md5認證
本實驗area1區域認證方式爲接口認證
area0認證方式爲區域md5認證
area2沒有配置認證方式算法
配置步驟 [R1]interface GigabitEthernet0/0/0 ip address 10.10.1.1 255.255.255.0 ospf authentication-mode simple cipher 123 interface GigabitEthernet0/0/1 ip address 192.168.1.254 255.255.255.0 interface LoopBack0 ip address 1.1.1.1 255.255.255.255 ospf 1 //默認id爲1 area 0.0.0.1 network 1.1.1.1 0.0.0.0 network 10.10.1.1 0.0.0.0 network 192.168.1.254 0.0.0.0 [R2]interface GigabitEthernet0/0/0 ip address 10.11.1.1 255.255.255.0 interface GigabitEthernet0/0/1 ip address 10.10.1.2 255.255.255.0 ospf authentication-mode simple cipher 123 interface GigabitEthernet0/0/2 interface LoopBack0 ip address 2.2.2.2 255.255.255.255 interface LoopBack1 ip address 6.6.6.6 255.255.255.255 ospf 1 area 0.0.0.0 authentication-mode md5 1 cipher 123 network 2.2.2.2 0.0.0.0 network 10.11.1.1 0.0.0.0 area 0.0.0.1 network 6.6.6.6 0.0.0.0 network 10.10.1.2 0.0.0.0 [R5]interface GigabitEthernet0/0/0 ip address 10.11.1.2 255.255.255.0 interface GigabitEthernet0/0/2 ip address 10.13.1.1 255.255.255.0 interface LoopBack0 ip address 3.3.3.3 255.255.255.255 ospf 1 area 0.0.0.0 authentication-mode md5 1 cipher 123 network 3.3.3.3 0.0.0.0 network 10.11.1.2 0.0.0.0 network 10.13.1.1 0.0.0.0 [R3]interface GigabitEthernet0/0/1 ip address 10.12.1.1 255.255.255.0 interface GigabitEthernet0/0/2 ip address 10.13.1.2 255.255.255.0 interface LoopBack0 ip address 4.4.4.4 255.255.255.0 interface LoopBack1 ip address 7.7.7.7 255.255.255.255 ospf 1 area 0.0.0.0 authentication-mode md5 1 cipher 123 network 7.7.7.7 0.0.0.0 network 10.13.1.2 0.0.0.0 area 0.0.0.2 network 4.4.4.4 0.0.0.0 network 10.12.1.1 0.0.0.0 [R4]interface GigabitEthernet0/0/0 ip address 192.168.2.254 255.255.255.0 interface GigabitEthernet0/0/1 ip address 10.12.1.2 255.255.255.0 interface GigabitEthernet0/0/2 interface LoopBack0 ip address 5.5.5.5 255.255.255.0 ospf 1 area 0.0.0.2 network 5.5.5.5 0.0.0.0 network 10.12.1.2 0.0.0.0 network 192.168.2.254 0.0.0.0 測試驗證