Pretpostavimo da smo direktno spojili dva rutera na kojima je aktiviran OSPFv2:
R1
router ospf 1
router-id 1.1.1.1
!
interface FastEthernet0/0
ip address 192.168.0.1 255.255.255.252
ip ospf authentication message-digest
ip ospf authentication-key Foo
ip ospf 1 area 0
R2
router ospf 1
router-id 2.2.2.2
!
interface FastEthernet0/0
ip address 192.168.0.2 255.255.255.252
ip ospf authentication message-digest
ip ospf authentication-key Bar
ip ospf 1 area 0
Primjećujete da se dva ključa za autentifikaciju razlikuju. Da li će ova dva rutera postati OSPFv2 susjedi?
Odgovor je da. Sada ću vam objasniti zašto...
Sjetite se da postoje tri vrste OSPFv2 autentifikacije:
Null - Bez autentifikacije (da, i ovo je vrsta autentifikacije)
Plain - Zajednički string(obični tekst) je uključen u svaki OSPF paket. (veoma slaba autentifikacija)
MD5 - Koristi se zajednička tajna za generisanje hasha koji je uključen u svaki OSPF paket.
Radi ilustracije pogledajmo kako izgleda obična(plain) autentifikacija unutar headera OSPF paketa:
Uporedimo to sada sa hash-baziranom autentifikacijom koju nam nudi MD5:
IOS komanda ip ospf authenticationse korisiti za konfigurisanje obične(plain) autentifikacije na interfejsu, dok se komanda ip ospf authentication message-digest koristi za konfigurisanje MD5 autentifikacije. Jednostavno, zar ne? Međutim, iza čoška vreba doza opasne dvosmislenosti: dvije veoma različite komande se koriste za konfigurisanje autentifikacijskih ključeva unutar ove dvije metode.
Pogledajmo output od komande show ip ospf interface na R1:
R1# show ip ospf interface
FastEthernet0/0 is up, line protocol is up
Internet Address 192.168.0.1/30, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10
Enabled by interface config, including secondary ip addresses
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router (ID) 2.2.2.2, Interface address 192.168.0.2
Backup Designated router (ID) 1.1.1.1, Interface address 192.168.0.1
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:07
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 2.2.2.2 (Designated Router)
Suppress hello for 0 neighbor(s)
Message digest authentication enabledNo key configured, using default key id 0
Primjećujete da iako je MD5 autentifikacija osposobljena, OSPF prijavljuje kako nismo konfigurisali autentifikacijski ključ, i automatski vraća postavke na defaultne, što znaći da će koristiti metodu null key(bez autentifikacije). Iz razloga što je "null key" isti na oba rutera, dva rutera će uspješno uspostaviti OSPF komšijski odnos.
Glavni problem ovjde je upotreba pogrešne komande za specificiranje autentifikacijskog ključa. ip ospf authentication-key se koristi samo za običnu autentifikaciju. Za upotrbu MD5 autentifikacijskog ključa, moramo koristiti komandu ip ospf message-digest-key:
R1(config)# interface f0/0
R1(config-if)# no ip ospf authentication-key
R1(config-if)# ip ospf message-digest-key 1 md5 FooBar
R2(config)# interface f0/0
R2(config-if)# no ip ospf authentication-key
R2(config-if)# ip ospf message-digest-key 1 md5 FooBar
Nakon ispravki u konfiguraciji, možemo vidjeti da je MD5 autentifikacija sada u upotrebi:
R1# show ip ospf interface
FastEthernet0/0 is up, line protocol is up
Internet Address 192.168.0.1/30, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10
Enabled by interface config, including secondary ip addresses
Transmit Delay is 1 sec, State BDR, Priority 1
Designated Router (ID) 2.2.2.2, Interface address 192.168.0.2
Backup Designated router (ID) 1.1.1.1, Interface address 192.168.0.1
Flush timer for old DR LSA due in 00:02:51
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:05
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 2.2.2.2 (Designated Router)
Suppress hello for 0 neighbor(s)
Message digest authentication enabled
Youngest key id is 1
Ovakva vrsta pogreške nas stvarno može skupo koštati, jer će na prvi pogled sve djelovati da radi kako treba, a u stvarnosti bilo ko sa lošim namjerama će moći uspostaviti OSPF komšijski odnos sa našim ruterom.