BGP は、TCP/IP ネットワーク内でドメイン間ルーティングを実行するための外部ゲートウェイ プロトコル(EGP)です。 BGP ルータは、BGP 更新を交換する前に、各 BGP ピアへの接続(TCP ポート 179 )を確立する必要があります。 2 つの BGP ピア間の BGP セッションは、それらのピアが別々の自律型システム(AS)内に存在する場合に、外部 BGP(eBGP)セッションと呼ばれます。 2 つの BGP ピア間の BGP セッションは、それらのピアが同じ自律型システム内に存在する場合に、内部 BGP(iBGP)セッションと呼ばれます。
デフォルトでは、ピアのルータに一番近いインターフェイスの IP アドレスを使用してピア関係が確立されます。 ただし、neighbor update-source(登録ユーザ専用)コマンドを使用すれば、ループバック インターフェイスを含む動作中の任意のインターフェイスを指定して TCP 接続を確立できます。 BGP ピア間に複数のパスがあるときには、ループバック インターフェイスを使用するこのピアリング方法を使用すると BGP セッションがダウンしないので便利です。この方法を使用しない場合、セッションの確立に使用している物理インターフェイスがダウンすると、BGP セッションが切断されてしまいます。 さらに、この方法では、複数のリンクがある BGP が動作するルータ間で、使用可能なパスを利用して負荷を分散することもできます。
このドキュメントの iBGP と eBGP の設定例には、ループバック アドレスを使用した場合と使用しない場合の両方があります。
注: これらの設定を使用してネイバー関係を確立できます。 より複雑な設定については、『ドメイン間ルーティングのための Border Gateway Protocol の使用』を参照してください。
この設定を試行する前に、次の要件が満たされていることを確認してください。
BGP プロトコルに関する知識
このドキュメントは、特定のソフトウェアやハードウェアのバージョンに限定されるものではありません。 このドキュメントに掲載されているコマンド出力は、IOS(R) バージョン 12.2(24a) が稼働する 2500 シリーズ ルータから採取されたものです。
ドキュメント表記の詳細は、『シスコ テクニカル ティップスの表記法』を参照してください。
このセクションでは、次の設定例を示しています。
この項では、このドキュメントで説明する機能の設定に必要な情報を提供します。
注: このドキュメントで使用されているコマンドの詳細を調べるには、Command Lookup Tool(登録ユーザ専用)を使用してください。
このドキュメントでは、次のネットワーク構成を使用しています。
この設定では、ルータは両方とも AS 400 です。
R1-AGS | R6-2500 |
---|---|
Current configuration: !-- Output suppressed. interface Serial1 ip address 10.10.10.1 255.255.255.0 ! router bgp 400 !--- Enables BGP for the autonomous !--- system 400. neighbor 10.10.10.2 remote-as 400 !--- Specifies a neighbor 10.10.10.2 !--- in the remote AS 400, making !--- this an iBGP connection. !-- Output suppressed. end |
Current configuration: !-- Output suppressed. interface Serial0 ip address 10.10.10.2 255.255.255.0 ! router bgp 400 neighbor 10.10.10.1 remote-as 400 !-- Output suppressed. end |
この設定では、ルータ R1-AGS は AS 300 であり、ルータ R6-2500 は AS 400 です。
R1-AGS | R6-2500 |
---|---|
Current configuration: !-- Output suppressed interface Serial1 ip address 10.10.10.1 255.255.255.0 ! router bgp 300 !--- Enables BGP for the autonomous !--- system 300. neighbor 10.10.10.2 remote-as 400 !--- Specifies a neighbor 10.10.10.2 !--- in the remote AS 400, making !--- this an eBGP connection. !-- Output suppressed. end |
Current configuration: !-- Output suppressed. interface Serial0 ip address 10.10.10.2 255.255.255.0 ! router bgp 400 neighbor 10.10.10.1 remote-as 300 !-- Output suppressed. end |
eBGP を使用している場合、ピアは直接接続する必要があります。 直接接続されていない場合、ルータが隣接関係を確立するためには、neighbor ebgp-multihop(登録ユーザ専用)コマンドを使用する必要があり、さらに IGP またはスタティック ルートを経由してピアに到達するパスが存在する必要があります。 上記の設定では、R1-AGS のルータが AS 300 に属しているのに対し、R6-2500 のルータは AS 400 に属しています。
このセクションに示すように、ループバック アドレス(または他の動作可能なインターフェイス)を使用して iBGP を設定できます。
R1-AGS | R6-2500 |
---|---|
Current configuration: !-- Output suppressed. interface Loopback0 ip address 1.1.1.1 255.255.255.255 ! interface Serial1 ip address 10.10.10.1 255.255.255.0 ! router bgp 300 neighbor 2.2.2.2 remote-as 300 neighbor 2.2.2.2 update-source Loopback0 !--- This command specifies that the TCP !--- connection with the specified external !--- peer should be established using the !--- address on the loopback interface. ! ip route 2.2.2.2 255.255.255.255 10.10.10.2 !--- This static route ensures that the !--- remote peer address used for peering !--- is reachable. !-- Output suppressed. end |
Current configuration: !-- Output suppressed. interface Loopback0 ip address 2.2.2.2 255.255.255.255 ! interface Serial0 ip address 10.10.10.2 255.255.255.0 ! router bgp 300 neighbor 1.1.1.1 remote-as 300 neighbor 1.1.1.1 update-source Loopback0 ! ip route 1.1.1.1 255.255.255.255 10.10.10.1 !-- Output suppressed. end |
このセクションに示すように、ループバック アドレス(または他の動作可能なインターフェイス)を使用して eBGP を設定することもできます。 ループバックインターフェイスがシングル および マルチホーム環境の BGP のロード シェアリングの BGP 隣接 セクションとしてループバックアドレスを使用してロード シェアリングに示すようにマルチパスとのネットワークの到達可能性を保証するのにこのように使用されています: 設定例』を参照してください。
R1-AGS | R6-2500 |
---|---|
Current configuration: !-- Output suppressed. interface Loopback0 ip address 1.1.1.1 255.255.255.255 ! interface Serial1 ip address 10.10.10.1 255.255.255.0 ! router bgp 300 neighbor 2.2.2.2 remote-as 400 neighbor 2.2.2.2 ebgp-multihop 2 !--- This command changes the ttl value in !--- order to allow the packet to reach the !--- external BGP peer which is not directly !--- connected or is using an interface other !--- than the directly connected interface. neighbor 2.2.2.2 update-source Loopback0 !--- This command specifies that the TCP !--- connection with the external BGP !--- peer should be established using the !--- address on the loopback interface. ! ip route 2.2.2.2 255.255.255.255 10.10.10.2 !--- This static route ensures that the !--- remote peer address used for peering !--- is reachable. !-- Output suppressed. end |
Current configuration: !-- Output suppressed. interface Loopback0 ip address 2.2.2.2 255.255.255.255 ! interface Serial0 ip address 10.10.10.2 255.255.255.0 ! router bgp 400 neighbor 1.1.1.1 remote-as 300 neighbor 1.1.1.1 ebgp-multihop 2 neighbor 1.1.1.1 update-source Loopback0 ! ip route 1.1.1.1 255.255.255.255 10.10.10.1 !-- Output suppressed. end |
このセクションでは、設定が正しく動作していることを確認するための情報を提供しています。 特定の show コマンドは、アウトプット インタープリタでサポートされています。このツールを使用すると、show コマンド出力を分析できます。
show ip bgp neighbors(登録ユーザ専用)コマンドを使用して、TCP と Border Gateway Protocol(BGP)の接続に関する情報を表示して、BGP ピアが確立されているかどうかを確認します。 次の show ip bgp neighbors コマンドの出力は、BGP の状態が「Established」であることが示されています。これは、BGP のピア関係が正しく確立されていることを示しています。
R1-AGS# show ip bgp neighbors | include BGP BGP neighbor is 10.10.10.2, remote AS 400, internal link BGP version 4, remote router ID 2.2.2.2 BGP state = Established, up for 00:04:20 BGP table version 1, neighbor version 1 R1-AGS#
show ip bgp neighbors コマンドは修飾子と上で使用されました | BGP を含んで下さい。 このようにすれば、コマンド出力にフィルタがかかって関連するポートだけが表示されるので、出力が読みやすくなります。
さらに、show ip bgp summary(登録ユーザ専用)コマンドを使用して、すべての BGP 接続の状態を表示することもできます。次に例を示します。
R1-AGS(9)# show ip bgp summary BGP router identifier 10.1.1.2, local AS number 400 BGP table version is 1, main routing table version 1 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.10.10.2 4 400 3 3 1 0 0 00:00:26 0
show ip bgp neighbors(登録ユーザ専用)コマンドを使用して、TCP と Border Gateway Protocol(BGP)の接続に関する情報を表示して、BGP ピアが確立されているかどうかを確認します。 次の show ip bgp neighbors コマンドの出力は、BGP の状態が「Established」であることが示されています。これは、BGP のピア関係が正しく確立されていることを示しています。
R1-AGS# show ip bgp neighbors | include BGP BGP neighbor is 10.10.10.2, remote AS 400, external link BGP version 4, remote router ID 2.2.2.2 BGP state = Established, up for 00:00:17 BGP table version 1, neighbor version 1
さらに、show ip bgp summary(登録ユーザ専用)コマンドを使用して、すべての BGP 接続の状態を表示することもできます。次に例を示します。
R1-AGS(9)# show ip bgp summary BGP router identifier 10.10.10.1, local AS number 300 BGP table version is 1, main routing table version 1 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.10.10.2 4 400 3 3 1 0 0 00:00:26 0
show ip bgp neighbors(登録ユーザ専用)コマンドを使用して、TCP と Border Gateway Protocol(BGP)の接続に関する情報を表示して、BGP ピアが確立されているかどうかを確認します。 次の show ip bgp neighbors コマンドの出力は、BGP の状態が「Established」であることが示されています。これは、BGP のピア関係が正しく確立されていることを示しています。
R1-AGS# show ip bgp neighbors | include BGP BGP neighbor is 2.2.2.2, remote AS 300, internal link BGP version 4, remote router ID 2.2.2.2 BGP state = Established, up for 00:00:28 BGP table version 1, neighbor version 1 R1-AGS#
さらに、show ip bgp summary(登録ユーザ専用)コマンドを使用して、すべての BGP 接続の状態を表示することもできます。次に例を示します。
R1-AGS(9)# show ip bgp summary BGP table version is 1, main routing table version 1 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 2.2.2.2 4 400 3 3 1 0 0 00:00:26 0
show ip bgp neighbors(登録ユーザ専用)コマンドを使用して、TCP と Border Gateway Protocol(BGP)の接続に関する情報を表示して、BGP ピアが確立されているかどうかを確認します。 次の show ip bgp neighbors コマンドの出力は、BGP の状態が「Established」であることが示されています。これは、BGP のピア関係が正しく確立されていることを示しています。
R1-AGS# show ip bgp neighbors | include BGP BGP neighbor is 2.2.2.2, remote AS 400, external link BGP version 4, remote router ID 2.2.2.2 BGP state = Established, up for 00:00:16 BGP table version 1, neighbor version 1 External BGP neighbor may be up to 2 hops away.
さらに、show ip bgp summary(登録ユーザ専用)コマンドを使用して、すべての BGP 接続の状態を表示することもできます。次に例を示します。
R1-AGS(9)# show ip bgp summary BGP router identifier 1.1.1.1, local AS number 300 BGP table version is 1, main routing table version 1 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 2.2.2.2 4 400 3 3 1 0 0 00:00:26 0
なぜアイドル状態、接続応答およびアクティブ状態の間で切り替わるために BGP 隣接をしなさいか参照して下さいか。 そしてトラブルシューティング情報のための BGP のトラブルシューティング。