OSPF 인증을 적용하여 보안을 강화할 수 있다.
네이버간에만 인증을 구현하는 RIP, EIGRP 및 BGP와는 달리 OSPF는 네이버 인증외에 에어리어 전체를 인증을 할 수 있다.


MD5-인증
#R1
router ospf 1
router-id 1.1.1.1
area 1 authentication message-digest //OSPF 인증방식
interface GigabitEthernet0/2
ip address 1.1.12.1 255.255.255.0
ip ospf message-digest-key 1 md5 cisco //네이버와 연결된 인터페이스에 인증키 지정
duplex auto
speed auto
media-type rj45
!
#R2
router ospf 1
router-id 1.1.2.2
area 1 authentication message-digest//OSPF 인증방식
interface GigabitEthernet0/2
ip address 1.1.12.2 255.255.255.0
ip ospf message-digest-key 1 md5 cisco //네이버와 연결된 인터페이스에 인증키 지정
duplex auto
speed auto
media-type rj45
!
인증키 및 인증암호가 틀릴 경우 서로 네이버 형성을 할수가 없다
평문-인증
#R1
router ospf 1
router-id 1.1.1.1
area 0 authentication //OSPF 인증방식
!
interface GigabitEthernet0/0
ip address 1.1.13.1 255.255.255.0
ip ospf authentication-key cisco //인증키 할당
duplex auto
speed auto
media-type rj45
!
#R3
router ospf 1
router-id 1.1.3.3
area 0 authentication //OSPF 인증방식
interface GigabitEthernet0/0
ip address 1.1.13.3 255.255.255.0
ip ospf authentication-key cisco //인증키 할당
duplex auto
speed auto
media-type rj45
!
인증키 및 인증암호가 틀릴 경우 서로 네이버 형성을 할수가 없다
네이버 인증 방식을 사용할려면 인증방식과 인증키를 모두 인터페이스에 할당한다.
평문인증방식
#R2
interface GigabitEthernet0/1
ip address 1.1.23.2 255.255.255.0
ip ospf authentication //인증방식
ip ospf authentication-key cisco //인증키
duplex auto
speed auto
media-type rj45
!
#R3
interface GigabitEthernet0/1
ip address 1.1.23.3 255.255.255.0
ip ospf authentication //인증
ip ospf authentication-key cisco
duplex auto
speed auto
media-type rj45
!
MD5인증방식
#R3
interface GigabitEthernet0/3
ip address 1.1.34.3 255.255.255.0
ip ospf authentication message-digest //인증방식
ip ospf message-digest-key 1 md5 cisco //인증키
duplex auto
speed auto
media-type rj45
!
interface GigabitEthernet0/3
ip address 1.1.34.4 255.255.255.0
ip ospf authentication message-digest //인증방식
ip ospf message-digest-key 1 md5 cisco //인증키
duplex auto
speed auto
media-type rj45
OSPF 인증키를 변경하면 일시적으로 네이버 관계가 단절되어
라우팅이 이루어지지 않는 경우가 있다.
이때는 하나의 인터페이스에 인증키를 2개를 설정하면 된다.(MD5방식에서만 사용가능 함 )
송신측은 2개의 인증키를 보내며 수칙은 자신의 인터페이스에 해당하는 인증키만을 수신한다(수신측 둘다 있아면 키번호 높은
녀석으로 인증 진행함)
OSPF 인증키 암호화 진행
service password-encryption //해당 명령어 미입력시 라우터 config 저장할때 인증키 암호화 안됨
interface GigabitEthernet0/3
ip address 1.1.34.4 255.255.255.0
ip ospf authentication message-digest
ip ospf message-digest-key 10 md5 7 13061E010803557A
duplex auto
speed auto
media-type rj45
!