JUNOS_aggregate_generate
よく混乱するのでメモ
Junosのaggregateとgenerateの違い
構成は下で、R2の設定を記載
[R1]----[R2]---<10.1.1.0/24>---[R3]
set routing-options static route 172.16.1.0/24 next-hop 10.1.1.254
set routing-options static route 172.16.2.0/24 next-hop 10.1.1.254
set routing-options static route 172.16.3.0/24 next-hop 10.1.1.254
set routing-options static route 172.17.1.0/24 next-hop 10.1.1.254
set routing-options static route 172.17.2.0/24 next-hop 10.1.1.254
set routing-options static route 172.17.3.0/24 next-hop 10.1.1.254
上のようなStaticを例に確認
この状態で、R2に以下のconfigを入れてみる。
set routing-options aggregate route 172.16.0.0/16
set routing-options generate route 172.17.0.0/16
確認
admin@R1# run show route
172.16.0.0/16 *[Aggregate/130] 00:01:06
Reject172.17.0.0/16 *[Aggregate/130] 00:01:06
> to 10.1.1.254 via ge-0/0/0.0
違いはRejectかNextHopが表示されるかの差
これはR1からPingを打てば分かる。
1)R1から172.16.4.1にPingを実行してみる。
# 172.16.4.0はaggregateに入っているレンジだけど、Staticでは登録していない
admin> ping 172.16.1.1
PING 172.16.1.1 (172.16.1.1): 56 data bytes
^C
--- 172.16.1.1 ping statistics ---
27 packets transmitted, 0 packets received, 100% packet lossadmin> ping 172.16.4.1
PING 172.16.4.1 (172.16.4.1): 56 data bytes
36 bytes from 192.168.10.1: Destination Net Unreachable
Vr HL TOS Len ID Flg off TTL Pro cks Src Dst
4 5 00 0054 5b43 0 0000 40 01 a4aa 192.168.10.2 172.16.4.1
2)R1から172.17.4.1にPingを実行してみる。
# 172.17.4.1はgenerateに入っているレンジだけど、Staticでは登録していない
admin> ping 172.17.4.1
PING 172.17.4.1 (172.17.4.1): 56 data bytes
^C
--- 172.17.4.1 ping statistics ---
16 packets transmitted, 0 packets received, 100% packet lossadmin>
→パケットは転送しているけど、対象のIPがないためPingの応答なし。
ちなみに、aggregateも以下のように設定してみる。
# set routing-options aggregate route 172.16.0.0/16 discard
設定後の確認
# run show route
172.16.0.0/16 *[Aggregate/130] 00:00:28
Discard
表示が「Reject→Discard」に変更
R1からのPing
admin> ping 172.16.4.1
PING 172.16.4.1 (172.16.4.1): 56 data bytes
^C
--- 172.16.4.1 ping statistics ---
7 packets transmitted, 0 packets received, 100% packet lossadmin>
ICMPでの到達不能を返していない。