ラボBGP AS-Pathアクセスリスト

ルートマップを使用したルートフィルタリング

R1:
s0 / 0:12.1.1.1/24
lo0:1.1.1.1/32
R2:
s0 / 0:12.1.1.2/24
s0 / 1:23.1.1.2/24
lo0:2.2.2.2/32
R3:
s0 / 0 :23.1.1.3/24
lo0:3.3.3.3/32

以下では、2つの例を使用して、ルートマップの使用法を理解しています。

手順1.各ルーターのIPアドレスを構成し、Pingコマンドを使用して、各ルーターの直接接続ポートの相互運用性を確認します。

ステップ2. R1、R2とR2、R3の間でEBGPを実行し、ループバックポートをアナウンスします。
R1(config-if)#router bgp 1
R1(config-router)#bgp router-id 1.1.1.1
R1(config-router)#no au
R1(config-router)#no sy
R1(config-router)#neighbor 12.1.1.2 remote-as 2
R1(config-router)#network 1.1.1.1 mask 255.255.255.255

R2(config)#router bgp 2
R2(config-router)#no au
R2(config-router)#no sy
R2(config-router)#bgp router-id 2.2.2.2
R2(config-router)#network 2.2。 2.2マスク255.255.255.255
R2(config-router)#nei 12.1.1.1 remote-as 1
R2(config-router)#neighbor 23.1.1.3 remote-as 3

R3(config)#router bgp 3
R3(config-router)#no au
R3(config-router)#no sy
R3(config-router)#bgp router-id 3.3.3.3        
R3(config-router)#neighbor 23.1。 1.2 remote-as 2
R3(config-router)#network 3.3.3.3 mask 255.255.255.255

ステップ3. AS2ルートをフィルタリングするために、R3の方向にルートマップを設定します。
R3(config)#ip as-path access-list 1 deny ^ _2 $
R3(config)#ip as-path access-list 1 permit。* //許可する

R3(config)#route-map FILTER permit 10
R3(config-route-map)#match as-path 1

R3(config)#router bgp 3
R3(config-router)#neighbor 23.1.1.2 route-map FILTER in 

ステップ4、查看R3的路由表、过滤成功。
R3#shのIP BGP 
BGPテーブルのバージョンがローカルルータIDが3.3.3.3である3、ある
ステータスコード:抑制S、D減衰、時間履歴、*有効な、>最高の、私-内部、
              r RIB-failure、S Stale
Originコード:i-IGP、e-EGP 、? - 不完全な

   ネットワークネクストホップメトリックLocPrfウェイトパス
*> 1.1.1.1/32 23.1.1.2 0 2 1 i
*> 3.3.3.3/32 0.0.0.0 0 32768 i

R3#sh ip route bgp 
     1.0.0.0/32 is subneted、1
subnets B 1.1.1.1 [20/0] via 23.1.1.2、00:01:55
 

公開された220元の記事 ウォンの賞賛2 ビュー4463

おすすめ

転載: blog.csdn.net/qq_43207781/article/details/105503820