BGP (TOPCISCO>Routing>BGP)

contents (RFC4271)
 BGP showコマンドサンプル
 F/Wをはさんだpeering
 BGP属性 attribue
 4byte ASN をサポートするために
 BGPルート集約 - aggregate-addressコマンド as-set summary-only
 BGP で 最適パス を選択するアルゴリズム attribueの優先順位
 cost community
 MED
 RIB-failure
 BGP RT constrained route distribution featureアップデート抑制
 PIC (BGP Prefix Independent Convergence)コンバージェンス改善
 BGP Prefix-Based Outbound Route Filteringアップデート抑制
 Site of Orgine ループ防止
 BGP add-path
 BGPマルチパス
 BGP条件付きアドバタイズ
 BGP同期
 BGP peer group
 BGP attribute(weight)
 BGPリセット
 AS Regular Expression RE 正規表現
 Load sharingと冗長性
 BGP hidden command

外部Link
 ConfederationでのAS_PATH属性の扱い(ALAXALA Networks)


F/Wをはさんだpeering
 ASA/PIX:ASAを経由するBGPの設定例 (英語版)



BGP属性 attribue (オナラと、小揚げ:ona-lato、coag)
   
well-known mandatory
周知強制、eBGPで必須
Origin
Next-hop
AS-path
well-known discretionary
周知任意、iBGPで必須
local-preference
atomic aggregate
optional transitive
オプション通知
認識できないBGPスピーカが受け取った場合、partialをマークしてピアに伝播する
community
aggregator
optional nontransitive
オプション非通知
認識できないBGPスピーカが受け取った場合破棄する
Multi-exit-discriminator
(MED)

4byte ASN をサポートするために  参考(JANOG20 (2007.7.12) P.10)

・ASを保持する属性(AS_PATH, AGGREGATOR)を4byteに拡張。
・2byteASNネイバーのケアは全て4byteASN側がする。
ケアについて
・送信時のケア(送信する属性の操作)
-AS_PATH, AGGREGATORの内容を2byte(AS_TRANS(23456))に変更しUPdate。
 ASリストに、23456が(とびとびで複数)在ってもループとしない。
-4byteASN情報は、別途作成(AS4_PATH, AS4_AGGREGATOR)しUPdate。
-これらは2byteASN側では理解できないためスルー。破棄はNG。
・受信時のケア(受信した属性の操作)
-AS4_xxxを参照して、AS_PATHとAGGREGATORへ4byteASNを書き戻す。

BGP属性について

AS_PATH
・経由した AS のリスト(行末(一番右側)が発生元で、経由するたびに左に追加)
・ASループの検出に利用

ATOMIC_AGGREGATE
・経路の集成(Aggregate)を行ったときに付加される属性
・集成の際に細かい経路に付加されていた情報が欠落したことを示す
・再び細かい経路に分けることはできない

AGGREGATOR
・経路の集成を行った BGP スピーカの IP アドレスと、それが属する AS 番号を示す属性

AS4_PATH、 AS4_AGGREGATOR (4byteASN用に追加)
・古い実装で4byteAS情報を通過させるために付加する。
 


BGPルート集約 - aggregate-addressコマンド as-set summary-only

(config-router)# aggregate-address 50.1.0.0 255.255.0.0 as-set summary-only

summary-onlyにより集約するとAS情報が失われる。これを残すことができる。

 


BGP で 最適パス を選択するアルゴリズム
attribueの優先順位
 (ウララーオムwlraom+エイ(コ)ei(c))   日本語,  English
  weight, localpreference, localRouter生成、As-path, origin(IGP<EGP<Incomplete), MED
 +eBGPpath>iBGP, IGP metric, (cost community)


cost community

route-map map-name {permit | deny}[sequence-number]
 set extcommunity cost [igp] community-id cost-value

The BGP Cost Community feature introduces the cost extended community attribute. The cost community is a non-transitive extended community attribute that is passed to internal BGP (iBGP) and confederation peers but not to external BGP (eBGP) peers. CCO


MED 
 bgp deterministic-med コマンドと bgp always-compare-med コマンドの相違点
 MED ループ

MED比較動作には2つのオプションがあり、ベストパス選択に影響を与える。2つは独立しており、両方ともdefault無効である。
 bgp deterministic-med [D]と略す
 bgp always-compare-med [A]と略す

BGPベストパス選択の一般ルール
・BGPテーブルの上から順に比較する
・BGPテーブルでは、新着prefixは上にリストされる。(上が新しい。下が古く優先される、勝負回数が少ない)

@ [D]も[A]も無効な場合
 ASが違う場合は、MEDを無視して勝負。

A [D]のみ有効な場合
 STEP1.「BGPテーブルの上から順に」をやらないで
  ASグループ内で、MED値の比較を含めて勝負。
  つまり各ASの代表を決めておく。
 STEP2.各AS代表たちで勝負(MEDは使わない)

B [A]のみ有効な場合
 ASを無視して、全ASでMED比較を含めて勝負。

C [D]も[A]も有効な場合
 STEP1.AのSTEP1と同じ(各ASの代表を決める)
 STEP2.各AS代表たちで勝負(MEDも使われる)


RIB-failure (IP : IP ルーティング BGP: FAQ)


BGP RT constrained route distribution feature
 BGP:RT 制約ルート配布の設定 (IP ルーティング:BGP コンフィギュレーション ガイド、Cisco IOS Release 15.1S)

・BGP: RT 制約ルート配布は、Route Reflector(RR)が RR および PE に送信する不要なルーティング アップデートを減らすためにサービス プロバイダがMPLS L3VPNで使用する機能である。
・ルーティング アップデートを減らすことにより、リソースを節約できる。RR、ASBR、PE が伝送するルートが少なくなる。
・ルーティング アップデートを制限するためにRT(ルート ターゲット)が使用される。

・不要なルートを除外するには、PE と RR に BGP:RT 制約ルート配布機能を設定する。
・PEは、(MP-BGP UPDATE メッセージを使用して)RTメンバーシップ情報を伝播させる。

router bgp as-number
 address-family rtfilter unicast
 neighbor x.x.x.x activate

・RRは、受信した RT メンバーシップに基づいて VPN ルートのアドバタイズメントを制限する。

router bgp as-number
 address-family rtfilter unicast
 neighbor x.x.x.x send-community extended
 neighbor x.x.x.x activate
 neighbor x.x.x.x route-reflector-client

この機能により、次の 2 種類の情報が交換される。
・PE は RT 制約 Network Layer Reachability Information(NLRI; ネットワーク層到着可能性情報)を RR に送信します。
・RR はアウトバウンド ルート フィルタをインストールする。
図3に、RT Constraint(RTC; RT 制約)NLRI とアウトバウンド ルート フィルタの交換を示す。

・ この機能(BGP:RT 制約ルート配布)を使用しない場合、アップデートのフィルタリングは PE が行う。
・ この機能を使用すると、アップデートのフィルタリングは RR が行う。

◆デフォルトの RT フィルタ default RT fileter
デフォルトのRTフィルタは値も0、長さも0で、次の場合に使われる。
・RT値にかかわらず、全てのVPNルートをピアへ送信する、ことをPeerが指示する
・RRへ全てのそのVPNルートをPEがアドバタイズする、ことをRRが要求する

以下はCCO抜粋

Default RT Filter

The default RT filter has a value of zero and length of zero. The default RT filter is used:

•By a peer to indicate that the peer wants all of the VPN routes sent to it, regardless of the RT value.

•By the RR to request that the PE advertise all of its VPN routes to the RR.

The default RT filter is created by configuring the neighbor default-originate command under the address-family rtfilter unicast command.

Question

Which option describes what the default RT filter indicates when you implement the BGP RT constrained route distribution feature?
A. A peer receives only a default route for each VRF.
B. A peer receives all routes, regardless of the RT value.
C. A peer receives routes only for RTs that are used on that router.
D. A peer receives no routes, regardless of the RT value.

Answer: B

PIC(Prefix independent convergence)英語版CCO 

・BGP PIC Edge for IPおよびMPLS-VPN機能は、ネットワーク障害後のBGPコンバージェンスを改善します。
・このコンバージェンスは、コア障害およびエッジ障害の両方に適用され、IPおよびMPLSネットワークの両方で使用できます。
・BGP PIC Edge for IPおよびMPLS VPN機能は、
 ルーティング情報ベース(RIB)、
 転送情報ベース(FIB)、
 シスコエクスプレスフォワーディングに
 バックアップ/代替パスを作成して保存します。
・これにより、障害が検出されたときに、 代替パスをすぐに引き継ぐことができ、迅速なフェールオーバーが可能になります。
Which two statements about BGP PIC are true? (Choose two)
 A. PIC Core supports fast convergence with external neighbor links.
 B. It is prefix-dependent for Internet routes.
 C. When the path to a distant PE router changes, PIC is independent of the number of VRFs on the router.
 D. It achieves subsecond convergence in the BGP FIB.
 E. PIC Edge provides fast convergence when an external neighbor node fails.


Answer: AD→AE D.x S/W CEF. Need CEF in line card.
 For platforms that support CEF processing in the line cards, the BGP PIC feature can converge in subseconds. 
 抜粋元CCO 英語CCO

For which two conditions is Cisco Express Forwarding recursion disabled by default when the BGP Prefix Independent Convergence functionality is enabled? (Choose two.)
 A. next hops learned with a /24 mask
 B. next hops learned with any mask shorter than /32
 C. next hops learned with a /32 mask
 D. next hops that are directly connected
(詳細版CCO英語版CCO)

Answer: CD
Which BGP feature enables you to install a backup path in the forwarding table?
 A. soft reconfiguration
 B. prefix independent convergence
 C. route refresh
 D. synchronization


Answer: B

BGP Prefix-Based ORF(Outbound Route Filtering) CCO「IP ルーティング:BGP コンフィギュレーション ガイド、 Cisco IOS Release 15.2M&T 外部 BGP を使用したサービス プロバイダー との接続」

・この機能は、経路情報を受信してからフィルタリングするのではなく、送信側でフィルタリングしてそもそも送信させなくし、UPDATEメッセージの量 とその処理負荷を減らすためのものである。。
・ アウトバンドルートフィルタリング・ケイパビリティーは、BGPセッション開始時にOPENメッセージでネゴシエーションされるオプション機能(ケイパビリティー)の1つであり、BGPピア間における受信用プレフィックスリストの送受信をサポートしていることを示す。 プレフィックス送信側へ、受信側の フィルタリング要件を伝える。
・BGP プレフィクスベース アウトバウンド ルート フィルタリングは、ピアルータへORF機能をアドバタイズしイネーブルになる。
・この機能がイネーブルの場合、送信側BGPスピーカーはインバウンド プレフィクス リスト フィルタをアウトバウンド フィルタとしてリモート ピアにインストールでき、これにより不要なルーティング アップデートを減少させることができる。

制限事項
• BGP プレフィクスベース アウトバウンド ルート フィルタリングはマルチキャストをサポートしていません。(←意味不明。そもそもM/Cを何に使うというのか。)
• アウトバウンド ルート フィルタリングに使用する IP アドレスは IP プレフィクス リストで定義されている必要があります。BGP 配信リストおよび IP アクセス リストはサポートしていません。
• アウトバウンド ルート フィルタリングはアドレス ファミリ単位ベースだけで設定され、ジェネラル セッションや BGP ルーティング プロセス下では設定できません。
• アウトバウンド ルート フィルタリングは、外部ピアリング セッションだけに設定できます。

neighbor capability orf prefix-list コマンドリファレンス
ピア ルータにアウトバウンド ルート フィルタ(ORF)機能をアドバタイズするには、アドレス ファミリまたはルータ コンフィギュレーション モードで neighbor capability orf prefix-list コマンドを使用します。
nneighbor ip-address capability orf prefix-list [ receive | send | both ]

ORF説明 参考サイト


SoO (「BGP のネイバーごとの SoO 設定」 BGP コンフィグレーションガイド、 Cisco IOS Release 15.2M&T)

Site of Origin BGP コミュニティ属性(日本語だがチョー理解困難、原英文がテキトーすぎる)

・あるサイトからのルートが、そのサイトに戻されるループを防止するため使用される。
・Site-of-Origin(SoO)はBGP拡張コミュニティ属性である。
・SoOは、ルータがルートを学んだサイトを一意に識別する。
・as-overrideやallowas-in によって、BGPのプレフィックスを回す様に設定した場合、ループ防止にSoOは使われる。

A「site2の2.2.2.2」が「同じAS番号100のsite1」で破棄されないように
 as-overrideをPE1に設定しておく。
 allowas-inをCE1に設定でもOK。
(AS属性の特性:自AS番号を持つアップデートは破棄し、ループ防止する)

B1.1.1.1にAS100のsite1からとSoO値100:1でタグ付け
 (@でも同様に2.2.2.2には(AS100のsite2からと)SoO値100:2でタグ付けされている)
 2.2.2.2にはすでにsite2のSoO(100:2)がついているため、site1のSoO(100:1)は追加されない。(←正しいか疑問)

CPE2がsite2へ配布する時は、同じsite2のSoO値(100:2)を持つ2.2.2.2は捨てる。1.1.1.1は送る。
 (A同様にASのループ防止を回避設定しておく。)

SoOはAS属性とほとんど同じ。上書き、追加されない。(←正しいか疑問)

as-override
PEで設定する。AS番号をPEのAS番号で書き換える。
allowas-in
CEで設定する。自ASのアップデートでも破棄しない。



BGPadd-pathRFC7911
 

英語版CCO抜粋
The BGP Additional Paths feature allows the advertisement of multiple paths through the same peering session for the same prefix without the new paths implicitly replacing any previous paths. This behavior promotes path diversity and reduces multi-exit discriminator (MED) oscillations.
BGP add-pathの特徴は、複数パスの広告ができるようになることであり、同じピアへのセッションで(を通して)、同じprefixを、新しいパスが以前のパスを置き換える事なしにである。
これにより以下のこと進められる、パスダイバーシティと、MEDのバタつきの低減を。

Problem That Additional Paths Can Solve

BGP routers and route reflectors (RRs) propagate only their best path over their sessions. The advertisement of a prefix replaces the previous announcement of that prefix (this behavior is known as an implicit withdraw). The implicit withdraw can achieve better scaling, but at the cost of path diversity.
BGPルーターとRRはベストパスのみを伝播する。Prefix広告は以前のパスを上書きする(この振る舞いをimplicit Withdrawという). そのWithdrawは旧パスをうまく落とすことができるが、パスダイバーシティは犠牲になる。

Path hiding can prevent efficient use of BGP multipath, prevent hitless planned maintenance, and can lead to MED oscillations and suboptimal hot-potato routing. Upon nexthop failures, path hiding also inhibits fast and local recovery because the network has to wait for BGP control plane convergence to restore traffic. The BGP Additional Paths feature provides a generic way of offering path diversity; the Best External or Best Internal features offer path diversity only in limited scenarios.
パス隠しによってBGPマルチパスが効率的に防ぐが、それだけである(他にメリットがない)。そして、MEDバタつきと最適でないホットポテトルーティング(=closed exit)を引き起こす可能性がある。nexthop障害時には、パス隠しは他にも抑制する 早さとローカルでのリカバリーを、理由はそのネットワークが待たねばならない、BGPコントロールプレーンの収束 トラフィックの修復のための。BGP Additional Pathは提供する、一般的なパスダイバーシティの提案方法を。

The BGP Additional Paths feature provides a way for multiple paths for the same prefix to be advertised without the new paths implicitly replacing the previous paths. Thus, path diversity is achieved instead of path hiding.
BGP Additional Pathは方法を提供する、 同じprefixへのマルチパス その新しいパスが以前のパスを上書きするインパクトなしで広告される。

メリット
-複数パス(=ベストパス以外も含めて)アドバタイズできる。
-複数パスがあると、ベストパス喪失時に次善パスに即座に切り替わる。

● 3. Extended NLRI Encodings(RFC7911抜粋)


3.  Extended NLRI Encodings

   In order to carry the Path Identifier in an UPDATE message, the NLRI
   encoding MUST be extended by prepending the Path Identifier field,
   which is of four octets.

   For example, the NLRI encoding specified in [RFC4271] is extended as
   the following:

                  +--------------------------------+
                  | Path Identifier (4 octets)     |
                  +--------------------------------+
                  | Length (1 octet)               |
                  +--------------------------------+
                  | Prefix (variable)              |
                  +--------------------------------+

   The usage of the extended NLRI encodings is specified in Section 5.


BGPマルチパス日本語版CCO抜粋英語版)

eBGPマルチパスには次の追加要件があります。
-パスは外部またはコンフェデレーション外部の近接ルータ(eBGP)から学習されます
-BGPネクストホップへのIGPメトリックは、最適パスのIGPメトリックと等しくなる必要があります。
iBGPマルチパスには次の追加要件があります。
-パスは、内部の近接ルータ(iBGP)から学習されます
-ルータが不等コスト iBGP マルチパスで設定されない限り、BGP ネクストホップへの IGP メトリックは、最適パスの IGP メトリックと等しくなる必要があります。
●BGP では、マルチパス候補から最近受信した、n 個までのパスが IP ルーティング テーブルに挿入されます。現在、n の最大値は 6 です。マルチパスがディセーブルになっている場合のデフォルト値は 1 です。
●不等コスト ロード バランシングでは、BGP リンク帯域幅も使用できます。

注:同等のnext-hop-self は、内部ピアに転送される前に、eBGP マルチパス間で選択される最適パスで実行されます。

Some BGP Multipath features put additional requirements on multipath candidates.
These are the additional requirements for eBGP multipath:
-The path should be learned from an external or confederation-external neighbor (eBGP).
-The IGP metric to the BGP next hop should be equal to the best-path IGP metric.
These are the additional requirements for iBGP multipath:
-The path should be learned from an internal neighbor (iBGP).
-The IGP metric to the BGP next hop should be equal to the best-path IGP metric, unless the router is configured for unequal-cost iBGP multipath.
BGP inserts up to n most recently received paths from multipath candidates in the IP routing table. The maximum value of n is currently 6. The default value, when multipath is disabled, is 1.
For unequal-cost load balancing, you can also use BGP Link Bandwidth.
Note: The equivalent next-hop-self is performed on the best path that is selected among eBGP multipaths before it is forwarded to internal peers.


BGP 条件付きアドバタイズ

自分のBGP テーブル中に、プレフィックスX.X.X.X/XXが存在しているかどうかに応じて、 (別のプレフィックスY.Y.Y.Y/YYをネイバーへ)アドバタイズする事ができる。

BGPテーブルにprefix x.x.x.xが存在して{いる/ない}間は、prefix y.y.y.yをアドバタイズする。

例 10.10.10.10/32が存在している間は、 172.16.0.0/24をアドバタイズする。

ip prefix-list EXIST_PL_XXXX permit 10 10.10.10.10/32

ip prefix-list ADV_PL_YYYY permit 10 172.16.0.0/24

route-map EXIST_RM_XXXX permit 10
match ip address prefix-list EXIST_PL_XXXX

route-map ADV_RM_YYYY   permit 10
match ip address predix-list ADV_PL_YYYY

router bgp 65000
neighbor x.x.x.x advertise-map ADV_RM_YYYY exist-map EXIST_RM_XXXX
aa

syntax

neighbor ip-address advertise-map map-name { exist-map map-name | non-exist-map 
map-name }
ip-address アドバタイズメントの送信先、BGPピア
advertise-map map-name アドバタイズしたいprefixを指定するルート マップの名前
exist-map map-name 条件用のprefixを指定するルートマップ名。BGPテーブルにそのprefixが”存在している”と条件が成立しアドバタイズする。
non-exist-map 条件用のprefixを指定するルートマップ名。BGPテーブルにそのprefixが”存在していない”と条件が成立しアドバタイズする。


BGP 同期 synchronizationn IGP.

Which BGP feature prevents a router from installing an iBGP learned route in its routing table until the route is validated 
within the IGP

Which statement about the BGP synchronization rule is true?

A.  A BGP router with synchronization enabled does not advertise its iBGP 
learned routes to its iBGP peers unless it has learned or verified this route on its routing table through an IGP.
B.  A BGP router with synchronization enabled does not advertise its eBGP 
learned routes to its iBGP peers unless it has learned or verified this route on its routing table through an IGP.
C.  A BGP router with synchronization enabled does not advertise its eBGP 
learned routes to its eBGP peers unless it has learned or verified this route on its routing table through an IGP.
D.  A BGP router with synchronization enabled does not advertise its iBGP 
learned routes to its eBGP peers unless it has learned or verified this route on its routing table through an IGP.
Answer: D

What is synchronization, and how does it influence BGP routes installed in the IP routing table?

If your AS passes traffic from another AS to a third AS, BGP should not advertise a route before all routers in your AS learn about the route via IGP. BGP waits until IGP propagates the route within the AS and then advertises it to external peers. A BGP router with synchronization enabled does not install iBGP learned routes into its routing table if it is not able to validate those routes in its IGP. Issue the no synchronization command under router bgp in order to disable synchronization. This prevents BGP from validating iBGP routes in IGP. Refer to BGP Case Studies: Synchronization for a more detailed explanation.

 

Nexthopについて

iBGP 変更しない。eBGP


BGP peer group (日本語CCO , 英語CCO

BGP ピア グループ主な利点 (分かりづらいので、日本語CCOの冒頭を箇条書きにしただけ)
 @アップデート生成で使用されるシステム リソース(CPU およびメモリ)量が削減される
 ABGP の設定も簡単になります。

@の補足
 ・ルーティング テーブルのチェックが一度だけになるため、システム リソースの負荷が軽減される。
 ・アップデートはピア グループ内の各ピアに対してではなく、ピア グループの全メンバに対して複製されるようになります。
 ・ピア グループ メンバの数、テーブル内のプレフィクスの数、アドバタイズされるプレフィクスの数によっては、負荷が大幅に軽減される可能性があります。
 ・同一の発信アナウンスメント ポリシーのピアをグループ化することを推奨します

IOS15.1 CCO BGP
BGP peer group (日本語CCO, 英語CCO)
BGP Update Group (日本語CCO, 英語CCO)
BGP Dynamic Update Group Configuration (日本語CCO, 英語CCO)
BGP Peer Templates (日本語CCO, 英語CCO)

 



BGP session reset (日本語CCO , 英語CCO

 CCO ハードリセットとソフトリセットの比較表 (英語版CCO)

Question Which three statements about BGP soft reconfiguration are true?
A. Outbound soft reconfiguration stores an additional copy of the routes advertised to a neighbor before routing policies take effect.
B. Inbound soft reconfiguration stores an additional copy of the routes received from a neighbor before routing policies take effect.
C. Outbound soft reconfiguration requires additional configuration on the BGP neighbor.
D. Inbound soft reconfiguration requires additional configuration on the BGP neighbor.
E. Outbound soft reconfiguration requires additional memory.
F. Inbound soft reconfiguration requires additional memory.


Answer: BDF

Attribute(weight)

AS100からinternetへのアクセス(out going)は
 Before:ISP1とISP2の両方を経由
 After :できる限りISP2を優先する
 属性操作:weightでコントロールする。
注意:R4のweight操作だけでは、完成しない。
log概要:R4でweight変更。一部がISP1を向いたまま。R5でもweight変更。全部ISP2を向く。

weight

 

R4 log

R4#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
B        1.1.1.1 [20/0] via 10.0.14.1, 00:02:57
      2.0.0.0/32 is subnetted, 1 subnets
B        2.2.2.2 [200/0] via 5.5.5.5, 00:02:57
      3.0.0.0/32 is subnetted, 1 subnets
B        3.3.3.3 [20/0] via 10.0.14.1, 00:02:57
      4.0.0.0/32 is subnetted, 1 subnets
C        4.4.4.4 is directly connected, Loopback0
      5.0.0.0/32 is subnetted, 1 subnets
O        5.5.5.5 [110/2] via 10.0.45.5, 00:03:17, FastEthernet0/0
      10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
C        10.0.14.0/24 is directly connected, FastEthernet0/1
L        10.0.14.4/32 is directly connected, FastEthernet0/1
B        10.0.25.0/24 [200/0] via 5.5.5.5, 00:02:57
C        10.0.45.0/24 is directly connected, FastEthernet0/0
L        10.0.45.4/32 is directly connected, FastEthernet0/0
B        10.0.123.0/24 [20/0] via 10.0.14.1, 00:02:57
B     192.168.0.0/24 [20/0] via 10.0.14.1, 00:02:57
R4#
R4#
R4#sh ip bgp
BGP table version is 10, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  1.1.1.1/32       10.0.14.1                0             0 101 i
 *   2.2.2.2/32       10.0.14.1                              0 101 102 i
 *>i                  5.5.5.5                  0    100      0 102 i
 *>  3.3.3.3/32       10.0.14.1                              0 101 103 i
 * i                  5.5.5.5                  0    100      0 102 103 i
 *>  4.4.4.4/32       0.0.0.0                  0         32768 i
 r>i 5.5.5.5/32       5.5.5.5                  0    100      0 i
 r>  10.0.14.0/24     10.0.14.1                0             0 101 i
 *   10.0.25.0/24     10.0.14.1                              0 101 102 i
 *>i                  5.5.5.5                  0    100      0 102 i
 *>  10.0.123.0/24    10.0.14.1                0             0 101 i
 * i                  5.5.5.5                  0    100      0 102 i
 *>  192.168.0.0      10.0.14.1                              0 101 103 i
 * i                  5.5.5.5                  0    100      0 102 103 i
R4#
R4#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R4(config)#router bgp 100
R4(config-router)#nei 5.5.5.5 weight 200
R4(config-router)#
R4(config-router)#end
R4#
Dec 20 09:11:26: %SYS-5-CONFIG_I: Configured from console by console
R4#
R4#
R4#sh ip bgp
BGP table version is 10, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  1.1.1.1/32       10.0.14.1                0             0 101 i
 *   2.2.2.2/32       10.0.14.1                              0 101 102 i
 *>i                  5.5.5.5                  0    100      0 102 i
 *>  3.3.3.3/32       10.0.14.1                              0 101 103 i
 * i                  5.5.5.5                  0    100      0 102 103 i
 *>  4.4.4.4/32       0.0.0.0                  0         32768 i
 r>i 5.5.5.5/32       5.5.5.5                  0    100      0 i
 r>  10.0.14.0/24     10.0.14.1                0             0 101 i
 *   10.0.25.0/24     10.0.14.1                              0 101 102 i
 *>i                  5.5.5.5                  0    100      0 102 i
 *>  10.0.123.0/24    10.0.14.1                0             0 101 i
 * i                  5.5.5.5                  0    100      0 102 i
 *>  192.168.0.0      10.0.14.1                              0 101 103 i
 * i                  5.5.5.5                  0    100      0 102 103 i
R4#
R4#clear ip bgp 5.5.5.5 soft in
R4#
R4#sh ip bgp 
BGP table version is 16, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  1.1.1.1/32       10.0.14.1                0             0 101 i
 *   2.2.2.2/32       10.0.14.1                              0 101 102 i
 *>i                  5.5.5.5                  0    100    200 102 i
 *   3.3.3.3/32       10.0.14.1                              0 101 103 i
 *>i                  5.5.5.5                  0    100    200 102 103 i
 *>  4.4.4.4/32       0.0.0.0                  0         32768 i
 r>i 5.5.5.5/32       5.5.5.5                  0    100    200 i
 r>  10.0.14.0/24     10.0.14.1                0             0 101 i
 *   10.0.25.0/24     10.0.14.1                              0 101 102 i
 *>i                  5.5.5.5                  0    100    200 102 i
 *   10.0.123.0/24    10.0.14.1                0             0 101 i
 *>i                  5.5.5.5                  0    100    200 102 i
 *   192.168.0.0      10.0.14.1                              0 101 103 i
 *>i                  5.5.5.5                  0    100    200 102 103 i
R4#
R4#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
B        1.1.1.1 [20/0] via 10.0.14.1, 00:04:37
      2.0.0.0/32 is subnetted, 1 subnets
B        2.2.2.2 [200/0] via 5.5.5.5, 00:00:26
      3.0.0.0/32 is subnetted, 1 subnets
B        3.3.3.3 [200/0] via 5.5.5.5, 00:00:26
      4.0.0.0/32 is subnetted, 1 subnets
C        4.4.4.4 is directly connected, Loopback0
      5.0.0.0/32 is subnetted, 1 subnets
O        5.5.5.5 [110/2] via 10.0.45.5, 00:04:57, FastEthernet0/0
      10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
C        10.0.14.0/24 is directly connected, FastEthernet0/1
L        10.0.14.4/32 is directly connected, FastEthernet0/1
B        10.0.25.0/24 [200/0] via 5.5.5.5, 00:00:26
C        10.0.45.0/24 is directly connected, FastEthernet0/0
L        10.0.45.4/32 is directly connected, FastEthernet0/0
B        10.0.123.0/24 [200/0] via 5.5.5.5, 00:00:26
B     192.168.0.0/24 [200/0] via 5.5.5.5, 00:00:26
R4#
R4#
R4#! At R5, change weight then clear ip bgp 10.0.25.2 soft in
R4#
R4#
R4#sh ip bgp
BGP table version is 18, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 1.1.1.1/32       5.5.5.5                  0    100    200 102 101 i
 *                    10.0.14.1                0             0 101 i
 *   2.2.2.2/32       10.0.14.1                              0 101 102 i
 *>i                  5.5.5.5                  0    100    200 102 i
 *   3.3.3.3/32       10.0.14.1                              0 101 103 i
 *>i                  5.5.5.5                  0    100    200 102 103 i
 *>  4.4.4.4/32       0.0.0.0                  0         32768 i
 r>i 5.5.5.5/32       5.5.5.5                  0    100    200 i
 r>i 10.0.14.0/24     5.5.5.5                  0    100    200 102 101 i
 r                    10.0.14.1                0             0 101 i
 *   10.0.25.0/24     10.0.14.1                              0 101 102 i
 *>i                  5.5.5.5                  0    100    200 102 i
 *   10.0.123.0/24    10.0.14.1                0             0 101 i
 *>i                  5.5.5.5                  0    100    200 102 i
     Network          Next Hop            Metric LocPrf Weight Path
 *   192.168.0.0      10.0.14.1                              0 101 103 i
 *>i                  5.5.5.5                  0    100    200 102 103 i
R4#sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
B        1.1.1.1 [200/0] via 5.5.5.5, 00:00:15
      2.0.0.0/32 is subnetted, 1 subnets
B        2.2.2.2 [200/0] via 5.5.5.5, 00:04:29
      3.0.0.0/32 is subnetted, 1 subnets
B        3.3.3.3 [200/0] via 5.5.5.5, 00:04:29
      4.0.0.0/32 is subnetted, 1 subnets
C        4.4.4.4 is directly connected, Loopback0
      5.0.0.0/32 is subnetted, 1 subnets
O        5.5.5.5 [110/2] via 10.0.45.5, 00:09:00, FastEthernet0/0
      10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
C        10.0.14.0/24 is directly connected, FastEthernet0/1
L        10.0.14.4/32 is directly connected, FastEthernet0/1
B        10.0.25.0/24 [200/0] via 5.5.5.5, 00:04:29
C        10.0.45.0/24 is directly connected, FastEthernet0/0
L        10.0.45.4/32 is directly connected, FastEthernet0/0
B        10.0.123.0/24 [200/0] via 5.5.5.5, 00:04:29
B     192.168.0.0/24 [200/0] via 5.5.5.5, 00:04:29
R4#

R5 log

R5#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
B       1.1.1.1 [200/0] via 4.4.4.4, 00:03:47
     2.0.0.0/32 is subnetted, 1 subnets
B       2.2.2.2 [20/0] via 10.0.25.2, 00:03:49
     3.0.0.0/32 is subnetted, 1 subnets
B       3.3.3.3 [20/0] via 10.0.25.2, 00:03:49
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/2] via 10.0.45.4, 00:04:07, FastEthernet0/0
     5.0.0.0/32 is subnetted, 1 subnets
C       5.5.5.5 is directly connected, Loopback0
     10.0.0.0/24 is subnetted, 4 subnets
B       10.0.14.0 [200/0] via 4.4.4.4, 00:03:47
C       10.0.25.0 is directly connected, FastEthernet0/1
C       10.0.45.0 is directly connected, FastEthernet0/0
B       10.0.123.0 [20/0] via 10.0.25.2, 00:03:49
B    192.168.0.0/24 [20/0] via 10.0.25.2, 00:03:49
R5#sh ip bgp
BGP table version is 12, local router ID is 5.5.5.5
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
*  1.1.1.1/32       10.0.25.2                              0 102 101 i
*>i                 4.4.4.4                  0    100      0 101 i
*> 2.2.2.2/32       10.0.25.2                0             0 102 i
* i3.3.3.3/32       4.4.4.4                  0    100      0 101 103 i
*>                  10.0.25.2                              0 102 103 i
r>i4.4.4.4/32       4.4.4.4                  0    100      0 i
*> 5.5.5.5/32       0.0.0.0                  0         32768 i
*  10.0.14.0/24     10.0.25.2                              0 102 101 i
*>i                 4.4.4.4                  0    100      0 101 i
r> 10.0.25.0/24     10.0.25.2                0             0 102 i
* i10.0.123.0/24    4.4.4.4                  0    100      0 101 i
*>                  10.0.25.2                0             0 102 i
* i192.168.0.0      4.4.4.4                  0    100      0 101 103 i
*>                  10.0.25.2                              0 102 103 i
R5#
R5#
R5#! At R4, change weight then clear ip bgp 5.5.5.5 soft in
R5#
R5#sh ip bgp
BGP table version is 12, local router ID is 5.5.5.5
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
*  1.1.1.1/32       10.0.25.2                              0 102 101 i
*>i                 4.4.4.4                  0    100      0 101 i
*> 2.2.2.2/32       10.0.25.2                0             0 102 i
*> 3.3.3.3/32       10.0.25.2                              0 102 103 i
r>i4.4.4.4/32       4.4.4.4                  0    100      0 i
*> 5.5.5.5/32       0.0.0.0                  0         32768 i
*  10.0.14.0/24     10.0.25.2                              0 102 101 i
*>i                 4.4.4.4                  0    100      0 101 i
r> 10.0.25.0/24     10.0.25.2                0             0 102 i
*> 10.0.123.0/24    10.0.25.2                0             0 102 i
*> 192.168.0.0      10.0.25.2                              0 102 103 i
R5# 
R5#
R5#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
B       1.1.1.1 [200/0] via 4.4.4.4, 00:05:49
     2.0.0.0/32 is subnetted, 1 subnets
B       2.2.2.2 [20/0] via 10.0.25.2, 00:05:51
     3.0.0.0/32 is subnetted, 1 subnets
B       3.3.3.3 [20/0] via 10.0.25.2, 00:05:51
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/2] via 10.0.45.4, 00:06:09, FastEthernet0/0
     5.0.0.0/32 is subnetted, 1 subnets
C       5.5.5.5 is directly connected, Loopback0
     10.0.0.0/24 is subnetted, 4 subnets
B       10.0.14.0 [200/0] via 4.4.4.4, 00:05:49
C       10.0.25.0 is directly connected, FastEthernet0/1
C       10.0.45.0 is directly connected, FastEthernet0/0
B       10.0.123.0 [20/0] via 10.0.25.2, 00:05:52
B    192.168.0.0/24 [20/0] via 10.0.25.2, 00:05:52
R5#
R5#
R5#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R5(config)#router bgp 100
R5(config-router)#nei 10.0.25.2 weight 200
R5(config-router)#end
R5#
R5#
.Dec 20 00:15:04: %SYS-5-CONFIG_I: Configured from console by console
R5#
R5#clear ip bgp 10.0.25.2 soft in 
R5#
R5#sh ip bgp
BGP table version is 19, local router ID is 5.5.5.5
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
*> 1.1.1.1/32       10.0.25.2                            200 102 101 i
*> 2.2.2.2/32       10.0.25.2                0           200 102 i
*> 3.3.3.3/32       10.0.25.2                            200 102 103 i
r>i4.4.4.4/32       4.4.4.4                  0    100      0 i
*> 5.5.5.5/32       0.0.0.0                  0         32768 i
*> 10.0.14.0/24     10.0.25.2                            200 102 101 i
r> 10.0.25.0/24     10.0.25.2                0           200 102 i
*> 10.0.123.0/24    10.0.25.2                0           200 102 i
*> 192.168.0.0      10.0.25.2                            200 102 103 i
R5#
R5#
R5#sh ip route 
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
B       1.1.1.1 [20/0] via 10.0.25.2, 00:00:20
     2.0.0.0/32 is subnetted, 1 subnets
B       2.2.2.2 [20/0] via 10.0.25.2, 00:00:20
     3.0.0.0/32 is subnetted, 1 subnets
B       3.3.3.3 [20/0] via 10.0.25.2, 00:00:20
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/2] via 10.0.45.4, 00:09:05, FastEthernet0/0
     5.0.0.0/32 is subnetted, 1 subnets
C       5.5.5.5 is directly connected, Loopback0
     10.0.0.0/24 is subnetted, 4 subnets
B       10.0.14.0 [20/0] via 10.0.25.2, 00:00:20
C       10.0.25.0 is directly connected, FastEthernet0/1
C       10.0.45.0 is directly connected, FastEthernet0/0
B       10.0.123.0 [20/0] via 10.0.25.2, 00:00:21
B    192.168.0.0/24 [20/0] via 10.0.25.2, 00:08:47
R5#


AS Regular Expression RE 正規表現 (引用元CCO日本語

正規表現 説明 補足
Range A range is a sequence of characters within left and right square brackets.
左角カッコと右角カッコの間に含まれる文字列
[abcd]  
Atom An atom is a single character. Here are some examples:
単一の文字
   
  . The . matches any single character.    
  ^ The ^ matches the start of the input string.    
  $ The $ matches the end of the input string.    
  \ The \ matches the character.    
  _ The _ matches a comma (,), left brace ({), right brace (}), the start of the input string, the end of the input string, or a space.
_には、コンマ(,)、左波カッコ({)、右波カッコ(})、入力文字列の先頭(^)、入力文字列の末尾($)、またはスペースが一致する
^100_

AS100経由
($)にも一致するため、^100$も含む
Piece A piece is one of these symbols, which follows an atom:
アトムの後に続く、次のいずれかの記号である
   
  * The * matches 0 or more sequences of the atom.    
  + The + matches 1 or more sequences of the atom    
  ? The ? matches the atom or the null string.    
Branch A branch is 0 or more concatenated pieces.
ピースが 0 個以上連結したもの



Load sharingと冗長性


BGP hidden command

ログは以下の通り
R4(config-router)#bgp bestpath as-path ignor?
% Unrecognized command
R4(config-router)#bgp bestpath as-path ignore  ←ここで入力する。エラーでない。
R4(config-router)#bgp bestpath as-path ?     
% Unrecognized command
R4(config-router)#bgp bestpath as-path  multipath-relax ←続けて入力したらエラーだ
% Cannot be used in conjunction with 'bgp bestpath as-path ignore'
R4(config-router)#do show run | sec router             
router bgp 100
 bgp log-neighbor-changes
 bgp bestpath as-path ignore
R4(config-router)#no bgp bestpath as-path ignore       
R4(config-router)#bgp bestpath as-path  multipath-relax
R4(config-router)#do show run | sec router             
router bgp 100
 bgp log-neighbor-changes
 bgp bestpath as-path multipath-relax
R4(config-router)#

 










inserted by FC2 system