■基礎編
1.はじめに
2.構成説明
3.基本Configを入れてみよう
4.ステータスを確認しよう
■アレンジ編
5.as-pathfilterを入れよう
6.prefix-listを使おう
7.Configをグループ化
8.LocalPreference値で経路制御してみよう
9.VRRP Trackingを組み合わせよう
10.MED値でお願いしてみよう
11.NATを併用してみよう
■再配送
12.Staticを再配布しよう
13.BGPをOSPFに再配布しよう
14.OSPFをBGPに再配布しよう
#####################################################
今まで経路を制御をしてきたweight値はベンダーの独自規格になります。搭載、非搭載はメーカーによりけりです。(CiscoはOK)
ということで第8回はアトリビュート、”Local Preference” の回です。BGPで経路制御をする際は、weightとLocal Preferenceの実質どちらかでしょう。
しかしながらweightはメーカー依存のアトリビュートのため、Local Preferenceを使う現場のほうが多いものと思います。weightよりも若干難しいです。
weightでは、2号機のiBGP迂回経路に200の重み付けをしました。
Local Preferenceも同じように、値の大きい出口から出て行くようにする属性です。weight同様デフォルト値が100、大きい値が優先されます。実装には2つのパターンが考えられます。
■パターン1 weight同様、2号機の渡りを200にするパターン
■パターン2 1号機の外接を200にするパターン
重要なのが、Local PreferenceはiBGP内に情報が伝搬されるという点です。外接200で設定した際には、ルータA→ルータBにiBGPで情報が伝わります。結果、ルータBは、ルータAの外接I/Fの優先度が高いことを認識します。
■実装
ルータAにて
※先にweightに関する行は削除済み
パターン1
router bgp 30000
neighbor 10.3.3.1 route-map LP_Primary in
neighbor 10.9.9.1 route-map LP_Primary in
ip access-list standard BGP_Primary_route
permit any
route-map LP_Primary permit 10
match ip address BGP_Primary_route
set local-preference 200
主系回線から受け取る全てのルートについて、1号機はルート情報を受け取った際に
優先順位200を付与する。
パターン2
router bgp 30000
neighbor 192.168.150.2 route-map LP_Primary out
ip access-list standard BGP_Primary_route
permit any
route-map LP_Primary permit 10
match ip address BGP_Primary_route
set local-preference 200
iBGPで1号機から2号機にルート情報を出力する際に、1号機は
優先順位200を付与し送出する。結果2号機はiBGP渡りの優先度が高いことを認識する。
■ステータス確認
show ip bgp
1812J-A# 1812J-A#show ip bgp BGP table version is 8, local router ID is 192.168.201.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale, m multipath, b backup-path, x best-external, f RT-Filter Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 172.16.100.0/24 10.3.3.1 0 200 0 20000 i *> 192.168.93.0 10.9.9.1 0 200 0 40000 i *> 192.168.94.0 10.9.9.1 0 200 0 40000 i *> 192.168.200.0 0.0.0.0 0 32768 i * i 192.168.150.2 0 100 0 i *> 192.168.201.0 0.0.0.0 0 32768 i * i 192.168.150.2 0 100 0 i 1812J-A# 1812J-A# 1812J-B# 1812J-B#show ip bgp BGP table version is 17, local router ID is 192.168.201.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *>i172.16.100.0/24 192.168.150.1 0 200 0 20000 i * 10.5.5.1 0 0 20000 i *>i192.168.93.0 192.168.150.1 0 200 0 40000 i * 10.11.11.1 0 0 40000 i *>i192.168.94.0 192.168.150.1 0 200 0 40000 i * 10.11.11.1 0 0 40000 i * i192.168.200.0 192.168.150.1 0 100 0 i *> 0.0.0.0 0 32768 i * i192.168.201.0 192.168.150.1 0 100 0 i *> 0.0.0.0 0 32768 i 1812J-B# 1812J-B# 1812J-B#
LocPrfが200となり、2号機のnexthopは外側でなく内側を向いている。
■Config
※好みでパターン1を採用。
part8.ルータA_config
part8.ルータB_config
※両機でOS Verが違うため、一部投入してるのに非表示になるConfigがあります。
ルータA・・15.1
ルータB・・12.4
——————————————————————–
★★ PR ★★★
——————————————————————–