底辺エンジニアの備忘録

30過ぎて、記憶力低下が著しい為、メモ代わりにしていく予定。 自身のスキルが低いので、内容の正確さは保障できません・・・OTL

JUNOS_OSPF_LSA

OSPFのLSA Typeをすぐ忘れてしまうので、再整理

構成は以下

f:id:klock_3rd:20180925012617p:plain

 

下記機器のConfigを記載

R1

set interfaces ge-0/0/0 unit 0 family inet address 172.16.1.1/24
set interfaces ge-0/0/1 unit 0 family inet address 10.1.1.1/24
set interfaces lo0 unit 0 family inet address 1.1.1.1/32
set routing-options static route 100.100.100.100/32 next-hop 10.1.1.254
set protocols ospf export to_ospf
set protocols ospf area 0.0.0.1 interface lo0.0
set protocols ospf area 0.0.0.1 interface ge-0/0/0.0
set policy-options policy-statement to_ospf term 1 from protocol static
set policy-options policy-statement to_ospf term 1 then accept 

 R2

set interfaces ge-0/0/0 unit 0 family inet address 172.16.1.254/24
set interfaces ge-0/0/1 unit 0 family inet address 172.16.2.254/24
set interfaces lo0 unit 0 family inet address 2.2.2.2/32
set protocols ospf area 0.0.0.1 interface lo0.0
set protocols ospf area 0.0.0.1 interface ge-0/0/0.0
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 interface-type p2p 

 R3

set interfaces ge-0/0/0 unit 0 family inet address 172.16.3.1/24
set interfaces ge-0/0/1 unit 0 family inet address 172.16.2.1/24
set interfaces lo0 unit 0 family inet address 3.3.3.3/32
set protocols ospf area 0.0.0.0 interface lo0.0
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 interface-type p2p
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 interface-type p2p

 R4

set interfaces ge-0/0/0 unit 0 family inet address 172.16.3.254/24
set interfaces ge-0/0/1 unit 0 family inet address 172.16.4.254/24
set interfaces lo0 unit 0 family inet address 4.4.4.4/32
set protocols ospf area 0.0.0.0 interface lo0.0
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 interface-type p2p
set protocols ospf area 0.0.0.2 stub
set protocols ospf area 0.0.0.2 interface ge-0/0/1.0 interface-type p2p

 R5

set interfaces ge-0/0/1 unit 0 family inet address 172.16.4.1/24
set interfaces lo0 unit 0 family inet address 5.5.5.5/32
set protocols ospf area 0.0.0.2 stub
set protocols ospf area 0.0.0.2 interface lo0.0
set protocols ospf area 0.0.0.2 interface ge-0/0/1.0 interface-type p2p

 

LSA Type1・・・ルータLSA

同一エリア内に通知

R1,R2,R4,R5で確認

 

admin@R1# run show ospf database router

  OSPF database, Area 0.0.0.1
Type    ID     Adv Rtr    Seq   Age Opt Cksum Len
Router *1.1.1.1   1.1.1.1    0x80000004 1018 0x22 0xe0b5 48
Router  2.2.2.2   2.2.2.2    0x80000003 1019 0x22 0xc9c4 48


admin@R2# run show ospf database router

  OSPF database, Area 0.0.0.0
Type    ID      Adv Rtr   Seq   Age Opt Cksum Len
Router *2.2.2.2   2.2.2.2    0x80000016  630 0x22 0x85ee 48
Router  3.3.3.3   3.3.3.3    0x80000018 1258 0x22 0xe5ba 84
Router  4.4.4.4   4.4.4.4    0x80000008 2234 0x22 0xc887 60

  OSPF database, Area 0.0.0.1
Type    ID      Adv Rtr   Seq   Age Opt Cksum Len
Router  1.1.1.1   1.1.1.1    0x80000004 1052 0x22 0xe0b5 48
Router *2.2.2.2   2.2.2.2    0x80000003 1051 0x22 0xc9c4 48


admin@R4# run show ospf database router

  OSPF database, Area 0.0.0.0
Type    ID      Adv Rtr   Seq   Age Opt Cksum Len
Router  2.2.2.2   2.2.2.2    0x80000016  654 0x22 0x85ee 48
Router  3.3.3.3   3.3.3.3    0x80000018 1279 0x22 0xe5ba 84
Router *4.4.4.4   4.4.4.4    0x80000008 2254 0x22 0xc887 60

  OSPF database, Area 0.0.0.2
Type    ID      Adv Rtr   Seq   Age Opt Cksum Len
Router *4.4.4.4   4.4.4.4    0x80000003 1999 0x20 0xb9b3 48
Router  5.5.5.5   5.5.5.5    0x80000003 2687 0x20 0x84bf 60


admin@R5# run show ospf database router

  OSPF database, Area 0.0.0.2
Type    ID      Adv Rtr   Seq   Age Opt Cksum Len
Router  4.4.4.4   4.4.4.4    0x80000003 2009 0x20 0xb9b3 48
Router *5.5.5.5   5.5.5.5    0x80000003 2695 0x20 0x84bf 60

各エリア内のOSPFルータが分かる 

 

 

LSA Type2・・・ネットワークLSA

同一エリア内通知

R1,R2で確認。

admin@R1# run show ospf interface     
Interface      State  Area      DR ID    BDR ID   Nbrs
ge-0/0/0.0     BDR   0.0.0.1     2.2.2.2   1.1.1.1    1
lo0.0        DR   0.0.0.1     1.1.1.1   0.0.0.0    0

[edit]
admin@R1# run show ospf database network  

  OSPF database, Area 0.0.0.1
Type    ID        Adv Rtr    Seq   Age Opt Cksum Len
Network 172.16.1.254   2.2.2.2   0x80000001 1525 0x22 0x5316 32

admin@R2# run show ospf interface     
Interface      State  Area      DR ID    BDR ID   Nbrs
ge-0/0/1.0     PtToPt 0.0.0.0     0.0.0.0   0.0.0.0    1
ge-0/0/0.0     DR   0.0.0.1     2.2.2.2   1.1.1.1    1
lo0.0        DR   0.0.0.1     2.2.2.2   0.0.0.0    0

[edit]
admin@R2# run show ospf database network  

  OSPF database, Area 0.0.0.1
Type    ID        Adv Rtr    Seq   Age Opt Cksum Len
Network *172.16.1.254   2.2.2.2   0x80000001 1546 0x22 0x5316 32

 →show ospf interfaceで、DRがR2(2.2.2.2)と判明。 show ospf database networkでもそのとおり。

チラ見に、R3,R4はp2pの設定があるため、出力はない

[edit]
admin@R3# run show ospf database network

[edit]
admin@R3#

 

LSA Type3・・・ネットワークサマリLSA

ABRが別エリアに流す際に使用。

R1で確認

 admin@R1# run show ospf database netsummary

  OSPF database, Area 0.0.0.1
Type    ID      Adv Rtr    Seq   Age Opt Cksum Len
Summary 3.3.3.3   2.2.2.2   0x80000002 1354 0x22 0xca5c 28
Summary 4.4.4.4   2.2.2.2   0x80000002 1139 0x22 0xa67b 28
Summary 5.5.5.5   2.2.2.2   0x80000002  924 0x22 0x829a 28
Summary 172.16.2.0  2.2.2.2   0x80000002  65 0x22 0xb9ba 28
Summary 172.16.3.0  2.2.2.2   0x80000002  710 0x22 0xb8b9 28
Summary 172.16.4.0  2.2.2.2   0x80000002  495 0x22 0xb7b8 28

 →R3,R4,R5のLoopback及び、それぞれのネットワークをR2(ABR)から受理

R3でも確認

admin@R3# run show ospf database netsummary

  OSPF database, Area 0.0.0.0
Type    ID      Adv Rtr    Seq   Age Opt Cksum Len
Summary 1.1.1.1   2.2.2.2   0x80000001 2106 0x22 0x2907 28
Summary 2.2.2.2   2.2.2.2   0x8000000d  395 0x22 0xd848 28
Summary 5.5.5.5   4.4.4.4   0x80000002  998 0x22 0x32e4 28
Summary 172.16.1.0  2.2.2.2   0x80000015 2106 0x22 0x9ec3 28
Summary 172.16.4.0  4.4.4.4   0x80000004 1252 0x22 0x6305 28

 →R2,R4のABRから受理している。

ちなみに、Area2はStub設定が入ってるが、StubはType3は許可するはずなので、確認

admin@R5# run show ospf database netsummary

  OSPF database, Area 0.0.0.2
Type    ID      Adv Rtr    Seq   Age Opt Cksum Len
Summary 1.1.1.1   4.4.4.4   0x80000001 2212 0x20 0x1f09 28
Summary 2.2.2.2   4.4.4.4   0x80000003  285 0x20 0xe240 28
Summary 3.3.3.3   4.4.4.4   0x80000003  13 0x20 0xaa75 28
Summary 4.4.4.4   4.4.4.4   0x80000002 1868 0x20 0x74a9 28
Summary 172.16.1.0  4.4.4.4   0x80000002 2377 0x20 0xbab2 28
Summary 172.16.2.0  4.4.4.4   0x80000002 2122 0x20 0xa5c7 28
Summary 172.16.3.0  4.4.4.4   0x80000002 1614 0x20 0x90dc 28

ちなみに、R4を以下を入れてTotally Stubにしてみる

set protocols ospf area 2 stub no-summaries

再度R5でLSA Type3を確認

admin@R5# run show ospf database netsummary

[edit]
admin@R5#

 →表示されない。 これは、Totally StubはLSA Type3は拒否するため。

 

LSA Type4・・・ASBRサマリLSA

ASBRのルータ情報を通知。 この場合はR1はstaticの再配信をしているのでASBRはR1になる。

R1,R3,R5で確認

admin@R1# run show ospf database asbrsummary

[edit]
admin@R1#

 

admin@R2# run show ospf database asbrsummary

  OSPF database, Area 0.0.0.0
Type    ID      Adv Rtr    Seq   Age Opt Cksum Len
ASBRSum *1.1.1.1   2.2.2.2   0x80000001 2787 0x22 0x1b14 28

[edit]

 

admin@R5# run show ospf database asbrsummary

[edit]
admin@R5#

R5はStubなので、Type4は受信しない。
R1はASBRだけど、自身が表示されないのは、Area1内はType1でASBRの情報を配信し、ABR(R2)が別エリアへ流す際にType4に変換するから表示されない。

 

LSA Type5・・・外部LSA

ASBRが生成

R1,R2,R4,R5で確認

admin@R1# run show ospf database external
  OSPF AS SCOPE link state database
Type    ID        Adv Rtr    Seq   Age Opt Cksum Len
Extern *100.100.100.100 1.1.1.1   0x80000002  358 0x22 0xd645 36


admin@R2# run show ospf database external   
  OSPF AS SCOPE link state database
Type    ID        Adv Rtr    Seq   Age Opt Cksum Len
Extern  100.100.100.100 1.1.1.1   0x80000002  436 0x22 0xd645 36


admin@R4# run show ospf database external  
  OSPF AS SCOPE link state database
Type    ID        Adv Rtr    Seq   Age Opt Cksum Len
Extern  100.100.100.100 1.1.1.1   0x80000002  452 0x22 0xd645 36

 

admin@R5# run show ospf database external

[edit]
admin@R5#

 →ASBR(R1)のルータ情報が見える。R5はstubなので不可