ネットワーク備忘録

アラフォーエンジニアのネットワーク系の備忘録。twitter:@deigo25374582

JUNOS_OSPF_import_policy

CSR1kv--area10--vSRX01--area0--vSRX02

 前回のarea-range はLSA Type3のフィルタ
今回は再配信した経路のフィルタ

CSR1kvで2.2.2.0/24 と 3.3.3.0/24 の経路をredistributeで配信
vSRX02で確認

 vSRX02> show ospf database
~略~
Type  ID    Adv Rtr   Seq  Age Opt Cksum Len
Extern 2.2.2.0   10.1.2.2   0x80000002 508 0x20 0x2169 36
Extern 3.3.3.0   10.1.2.2   0x80000001 1440 0x20 0xfe89 36

2.2.2.0/24     *[OSPF/150] 00:00:07, metric 20, tag 0
          > to 10.1.1.2 via ge-0/0/0.0
3.3.3.0/24     *[OSPF/150] 00:31:20, metric 20, tag 0
          > to 10.1.1.2 via ge-0/0/0.0

 →外部として載ってる。

ここでvSRX02を以下に設定

 set protocols ospf import to_srx
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0

set policy-options policy-statement to_srx term 1 from route-filter 2.2.2.0/24 exact
set policy-options policy-statement to_srx term 1 then reject

 routing確認

vSRX02# run show ospf database

Type  ID    Adv Rtr   Seq  Age Opt Cksum Len
Extern 2.2.2.0   10.1.2.2   0x80000002 1001 0x20 0x2169 36
Extern 3.3.3.0   10.1.2.2   0x80000001 1933 0x20 0xfe89 36

vSRX02# run show route protocol ospf


3.3.3.0/24     *[OSPF/150] 00:32:41, metric 20, tag 0
          > to 10.1.1.2 via ge-0/0/0.0

 2.2.2.0/24が消えた

 

JUNOS_OSPF_area-range

どわすれしてたので反省

 

CSR1kv--area10--vSRX01--area0--vSRX02

 

vSRX02のlo0(172.16.1.0/24)をCSR1kvへ広告したくない場合

まずは何もしない状態のvSRX01

set protocols ospf area 0.0.0.0 interface ge-0/0/1.0
set protocols ospf area 0.0.0.10 interface ge-0/0/0.0

この状態でのCSR1kvのroute

csr1kv02#show ip route 172.16.1.0
Routing entry for 172.16.1.0/24
 Known via "ospf 1", distance 110, metric 2, type inter area
 Last update from 10.1.2.1 on GigabitEthernet2, 00:01:13 ago
 Routing Descriptor Blocks:
 * 10.1.2.1, from 10.1.1.2, 00:01:13 ago, via GigabitEthernet2
   Route metric is 2, traffic share count is 1

 

vSRX01を以下に編集

set protocols ospf area 0.0.0.0 area-range 172.16.1.0/24 restrict
set protocols ospf area 0.0.0.0 interface ge-0/0/1.0
set protocols ospf area 0.0.0.10 interface ge-0/0/0.0

 

 再度確認

csr1kv02#show ip route 172.16.1.0
% Network not in table

 

area-rangeの設定するAreaを勘違いしてた。