OSPFエリア認証と特定のインターフェースにて認証を無効化(ip ospf authentication null)




条件
・R1 にて LSA type6(multicast OSPF) を受け取ったときにログを生成しないようにしてください。
・誤ったルーティング情報が流れ込まないようにするため、R1 - R2 間で認証を設定してください。
・その際、 ip ospf authentication message-digest コマンドは使わないでください。
・認証にはMD5、キー番号は7を使ってください。また sh run では暗号化して保存するようにしてください。
・R2 - R3 間ではルーティング情報を暗号化しないでください。


まず下記設定からスタートです。

R1
interface Serial1/0
ip address 1.1.1.1 255.255.255.0
!
router ospf 1
 network 1.1.1.0 0.0.0.255 area 0

R2
interface Serial1/0
ip address 1.1.1.2 255.255.255.0
!
interface Serial1/1
ip address 2.2.2.2 255.255.255.0
!
router ospf 1
network 1.1.1.0 0.0.0.255 area 0
network 2.2.2.0 0.0.0.255 area 0

R3
interface s1/1
ip add 2.2.2.3 255.255.255.0
!
router ospf 1
network 2.2.2.0 0.0.0.255 area 0



まず一つめの条件。
・R1 にて LSA type6(multicast OSPF) を受け取ったときにログを生成しないようにしてください。

Cisco機器ではOSPF type 6 パケットはサポートされていません。またデフォルトでこのパケット
を受け取ったときにログを吐くようになっています。これを無効化するコマンドとしては、

R1
router ospf 1
ignore lsa mospf

です。

参考
http://www.cisco.com/cisco/web/support/JP/docs/SW/LANSWT-Access/CAT1600SWT/UG/001/iro_osp1.html?bid=0900e4b1825ae7c3#pgfId-1040571


はい。次はいっきに2つめから4つめまで。
・誤ったルーティング情報が流れ込まないようにするため、R1 - R2 間で認証を設定してください。
・その際、 ip ospf authentication message-digest コマンドは使わないでください。
・認証にはMD5、キー番号は7を使ってください。また sh run では暗号化して保存するようにしてください。
・R2 - R3 間ではルーティング情報を暗号化しないでください。

R1 - R2 間で認証設定なのですが、ip ospf authentication message-digest を使っちゃいけないので、
エリア認証しかありません。しかし R2 でエリア認証を有効化すると R2 - R3 間の同じエリアなので
認証が効いてしまいます。ので、R2 s1/1 にて認証無効化のコマンドを打ってやります。
また sh run 内にて暗号化させるコマンドとしては、service password-encryption です。

R1
service password-encryption

interface s1/0
ip ospf message-digest-key 7 md5 cisco

router ospf 1
area 0 authentication message-digest

R2
service password-encryption

interface s1/0
ip ospf message-digest-key 7 md5 cisco

interface s1/1
ip ospf authentication null

router ospf 1
area 0 authentication message-digest


R2#sh ip ospf int
Serial1/1 is up, line protocol is up
  Internet Address 2.2.2.2/24, Area 0
  Process ID 1, Router ID 2.2.2.2, Network Type POINT_TO_POINT, Cost: 64
  Transmit Delay is 1 sec, State POINT_TO_POINT,
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:04
  Supports Link-local Signaling (LLS)
  Index 2/2, 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.3
  Suppress hello for 0 neighbor(s)
Serial1/0 is up, line protocol is up
  Internet Address 1.1.1.2/24, Area 0
  Process ID 1, Router ID 2.2.2.2, Network Type POINT_TO_POINT, Cost: 64
  Transmit Delay is 1 sec, State POINT_TO_POINT,
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:01
  Supports Link-local Signaling (LLS)
  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 4 msec
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 1.1.1.1
  Suppress hello for 0 neighbor(s)
  Message digest authentication enabled
    Youngest key id is 7


R2 にて sh ip ospf interface を見ると、S1/1 は認証が効いていませんが、
S1/0は認証されていることがわかりますね。


R2#debug ip ospf packet
OSPF packet debugging is on
R2#
*Aug 19 12:54:27.215: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.3
      aid:0.0.0.0 chk:E491 aut:0 auk: from Serial1/1
*Aug 19 12:54:35.467: OSPF: rcv. v:2 t:1 l:48 rid:1.1.1.1
      aid:0.0.0.0 chk:0 aut:2 keyid:7 seq:0x5030E251 from Serial1/0
*Aug 19 12:54:37.143: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.3
      aid:0.0.0.0 chk:E491 aut:0 auk: from Serial1/1
*Aug 19 12:54:45.427: OSPF: rcv. v:2 t:1 l:48 rid:1.1.1.1
      aid:0.0.0.0 chk:0 aut:2 keyid:7 seq:0x5030E25B from Serial1/0
*Aug 19 12:54:47.047: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.3
      aid:0.0.0.0 chk:E491 aut:0 auk: from Serial1/1
*Aug 19 12:54:53.987: OSPF: rcv. v:2 t:1 l:48 rid:1.1.1.1
      aid:0.0.0.0 chk:0 aut:2 keyid:7 seq:0x5030E265 from Serial1/0
*Aug 19 12:54:55.755: OSPF: rcv. v:2 t:1 l:48 rid:2.2.2.3
      aid:0.0.0.0 chk:E491 aut:0 auk: from Serial1/1


また、上記 debug ip ospf packet では、s1/0へは autheticate type 2 (aut:2)でパケットを出していて、
S1/1 へは autheticate type 0 (aut:0)でパケットを出していることがわかります。


更新日:2012年8月19日