gorosuke5656の日記

ネットワーク好きで個人で色々勉強しています😀 ですので内容はメーカーの公式見解ではありません🙇‍♀️

Juniper BGPにおけるAS_Pathフィルタリング設定と確認

お疲れさまです~
今回はBGPにおけるAS_Pathフィルタリングについて設定および確認をします(^^;)

お品書きです~
① AS_Pathフィルタリングとは?
② AS_Pathフィルタリングの設定および確認
 (1) 特定のASのみの経路を受信する設定と確認
 (2) 非トランジットASの設定と確認

では始めます~

 

① AS_Pathフィルタリングとは?

AS_Pathフィルタリングとは??



 

www.infraexpert.com

www.infraexpert.com


いつものサイトでございます~

Juniperサイトも参考にしました~
  

www.juniper.net

 

② AS_Pathフィルタリングの設定
  いつもの構成で以下を実施します

 (1) 特定のASのみの経路を受信する設定と確認
 (2) 非トランジットASの設定と確認

 

(1) 特定のASのみの経路を受信する設定と確認

構成図

実施手順

フィルタ適用前のルーティングテーブル

AS65100からの経路を受信しない設定を投入します!

・BGPピアをクリアした後、確認してみましょう!

[edit]
admin@SRX100B# run clear bgp neighbor soft-inbound instance VR2


[edit]
admin@SRX100B# run show route table VR2.inet.0 protocol bgp

VR2.inet.0: 14 destinations, 16 routes (11 active, 0 holddown, 4 hidden)
+ = Active Route, - = Last Active, * = Both

10.1.6.0/24        *[BGP/170] 00:37:35, MED 10, localpref 100, from 50.6.1.1
                      AS path: 65001 I
                    > to 172.16.6.254 via fe-0/0/2.0
                    [BGP/170] 00:37:27, MED 20, localpref 100, from 50.5.1.1
                      AS path: 65001 I
                    > to 172.16.5.254 via fe-0/0/1.0

→ Cisco(AS65100)からのBGP経路が受信されなくなりました

(フィルタされています!)

[edit]
admin@SRX100B# run show route receive-protocol bgp 172.16.210.1

inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)

VR1.inet.0: 14 destinations, 17 routes (14 active, 0 holddown, 0 hidden)

VR2.inet.0: 14 destinations, 16 routes (11 active, 0 holddown, 4 hidden)

[edit]
admin@SRX100B#

  → 当たり前ですがCiscoからのBGP経路をこちらでも受信できていない

  ことが確認できますね!

 

お次にいきましょう~(^^;)

(2) 非トランジットASの設定と確認

構成図

実施手順

・(1)で設定したポリシーを削除します

[edit]
admin@SRX100B# delete routing-instances VR2 protocols bgp group EXTERNAL-AS65100 import AS-FILTER-65100

[edit]
admin@SRX100B# commit check
configuration check succeeds

[edit]
admin@SRX100B# commit
commit complete

・BGPピアをクリアした後、確認してみましょう!

[edit]
admin@SRX100B# run clear bgp neighbor soft-inbound instance VR2

[edit]
admin@SRX100B# run show route table VR2.inet.0 protocol bgp

VR2.inet.0: 14 destinations, 16 routes (14 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.1/32          [BGP/170] 00:17:53, localpref 100
                      AS path: 65100 I
                    > to 172.16.200.1 via fe-0/0/0.0
10.1.6.0/24        *[BGP/170] 00:16:11, MED 10, localpref 100, from 50.6.1.1
                      AS path: 65001 I
                    > to 172.16.6.254 via fe-0/0/2.0
                    [BGP/170] 00:16:37, MED 20, localpref 100, from 50.5.1.1
                      AS path: 65001 I
                    > to 172.16.5.254 via fe-0/0/1.0
200.200.200.0/24   *[BGP/170] 00:17:53, localpref 100
                      AS path: 65100 I
                    > to 172.16.200.1 via fe-0/0/0.0
210.210.210.0/24   *[BGP/170] 00:17:53, localpref 100
                      AS path: 65100 I
                    > to 172.16.200.1 via fe-0/0/0.0
220.220.220.0/24   *[BGP/170] 00:17:53, localpref 100
                      AS path: 65100 I
                    > to 172.16.200.1 via fe-0/0/0.0

Cisco(AS65100)からのBGP経路が受信できていますよね~

 

設定前確認~

設定内容


設定後、BGPピアをクリアにします。
 admin@SRX100B>clear bgp neihgbor soft-inbound

設定後の確認

〇このままほっておくと忘れそうなので。。先ほどの”ONLY-MYROUTE”を
exportしたところだけを削除。。

[edit routing-instances VR2 protocols bgp group EXTERNAL-AS65100]
admin@SRX100B# delete export ONLY-MYROUTE


[edit routing-instances VR2 protocols bgp group EXTERNAL-AS65100]
admin@SRX100B# run clear bgp neighbor soft-inbound instance VR2

[edit routing-instances VR2 protocols bgp group EXTERNAL-AS65100]
admin@SRX100B# run show route advertising-protocol bgp 172.16.200.1

VR2.inet.0: 15 destinations, 18 routes (15 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 2.2.2.2/32              Self                                    I
* 10.1.5.0/24             Self                                    65001 I
* 10.1.6.0/24             Self                                    65001 I

[edit routing-instances VR2 protocols bgp group EXTERNAL-AS65100]
admin@SRX100B# run show route receive-protocol bgp 172.16.200.254

inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)

VR1.inet.0: 15 destinations, 18 routes (15 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 2.2.2.2/32              172.16.200.254                          65000 I
* 10.1.5.0/24             172.16.200.254                          65000 65001 I
* 10.1.6.0/24             172.16.200.254                          65000 65001 I

VR2.inet.0: 15 destinations, 18 routes (15 active, 0 holddown, 0 hidden)

 

 

 

BGPは奥深い。。
まだまだ勉強足りないな。。(;^_^A

次回はcommunity値を活用した経路制御について書きたいと思います(^^;)