[index] AT-AR3050S/AT-AR4050S コマンドリファレンス 5.4.5
Note - 本解説編は「IPルーティング」の章ですが、本製品のBGPはIPv4/IPv6両対応として実装されているため、ここではIPv6におけるBGPの使用方法についても説明しています。
Note - IPv4だけに対応したオリジナルのBGPを「BGP」または「BGP4」、マルチプロトコル拡張によってIPv6に対応したBGPを「BGP+」または「BGP4+」と言い表すことがありますが、本マニュアルでは原則として「BGP/BGP+」という呼び分けをせずに、「BGP/BGP+」の総称として「BGP」を用いています。なお、IPv4、IPv6のそれぞれに特化した話題は、適宜「IPv4環境における〜」、「IPv6 BGPピアに対して〜」のように対象を明記しています。
Note - 本製品のIPv6ホスト機能はつねに有効なため、インターフェースにIPv6アドレスを設定するだけでIPv6ホストとしての動作が可能です。ただし、IPv6パケットの転送機能(IPv6ルーティング)は初期設定で無効なため、IPv6ルーターとして動作させる場合は同機能の有効化(ipv6 forwardingコマンド)が必要です。詳しくは「IPv6ルーティング」/「一般設定」をご覧ください。
スタブAS(Stub AS) | 1つのASとだけ1点で接続しているAS。自AS宛てのトラフィックだけを受け入れる。 |
マルチホームAS(Multihomed AS) | 1つのASと複数点で接続している、あるいは、複数のASと接続しているASのうち、自AS宛てのトラフィックだけを受け入れ、他AS宛てのトラフィックは通過させないもの |
トランジットAS(Transit AS) | 複数のASと接続しており、自AS宛てのトラフィックだけでなく、他AS宛てのトラフィックも(ポリシーに応じて)通過を許可するAS |
[IPv4]
172.16.10.0/24
172.16.10.0/255.255.255.0
[IPv6]
2001:db8:10::/48
1 | OPEN | BGPセッションを開始するためのメッセージ。ルーター間にTCPコネクションが確立した直後に送られる。各ルーターの所属ASを通知しあったり、タイマー値のネゴシエーションを行ったりする |
2 | UPDATE | 経路情報の通知に使うメッセージ。新規プレフィックスの通知や無効になったプレフィックスの取り消し依頼などを相手に通知する |
3 | NOTIFICATION | プロトコル上のエラーを相手に通知するためのメッセージ。BGPセッションの終了通知にも使われる |
4 | KEEPALIVE | BGPセッションが有効であることを確認するためのメッセージ。定期的に送信される |
5 | ROUTE-REFRESH | BGPピアに対し、すべての経路情報を送信しなおすよう要求するためのメッセージ(RFC2918による拡張) |
1 | ORIGIN | well-known mandatory | プレフィックスがどのようにしてBGPに取り込まれたかを示す |
2 | AS_PATH | well-known mandatory | プレフィックスがどのような経路をたどって通知されてきたかを示す |
3 | NEXT_HOP | well-known mandatory | プレフィックス宛トラフィックのネクストホップアドレスを示す |
4 | MULTI_EXIT_DISC | optional non-transitive | 隣接ASと複数点で接続している場合に、特定プレフィックス宛トラフィックのNEXTHOPとしてどちらが適切であるかを(隣接ASに対して)示す一種のメトリック(コスト)。小さいほどコストが低い(優先度が高い) |
5 | LOCAL_PREF | well-known discretionary | AS内における(iBGP)経路選択のための優先度。大きいほど優先度が高い |
6 | ATOMIC_AGGREGATE | well-known discretionary | プレフィックスが集約されたものであることを示す |
7 | AGGREGATOR | optional transitive | プレフィックスを集約したASおよびBGPスピーカーのBGP識別子を示す |
8 | COMMUNITIES | optional transitive | コミュニティーを示す(RFC1997による拡張属性) |
9 | ORIGINATOR_ID | optional non-transitive | 該当経路を最初に学習したiBGPピアのBGP識別子(ルーターID)を示す。ルートリフレクション使用時に経路情報のループを防ぐために使われる(RFC2796による拡張属性) |
10 | CLUSTER_LIST | optional non-transitive | AS内における該当経路のリフレクトパスを示す。ルートリフレクターは、経路を再通知(リフレクト)するときに自身のクラスターID(CLUSTER_ID)を本属性に付加する。ルートリフレクション使用時に経路情報のループを防ぐために使われる(RFC2796による拡張属性) |
14 | MP_REACH_NLRI | optional non-transitive | BGPが標準でサポートしているIPv4ユニキャスト以外の到達可能プレフィックスを通知するための拡張属性。本製品はIPv6ユニキャスト経路にのみ対応している |
15 | MP_UNREACH_NLRI | optional non-transitive | BGPが標準でサポートしているIPv4ユニキャスト以外の削除対象プレフィックスを通知するための拡張属性。本製品はIPv6ユニキャスト経路にのみ対応している |
Note - 以下の例ではIPv4のプレフィックスを使用していますが、IPv6の場合もプレフィックスの長さと形式が異なるだけで各属性の説明には違いがありません。
Note - BGP IPv4アドレスファミリーモード(unicast)で実行したコマンドは、コンフィグ上ではBGPモードのコマンドに変換されます。そのため、BGPモードとBGP IPv4アドレスファミリーモード(unicast)の両方で実行できるコマンドは、本マニュアルではBGPモードのコマンドとしてのみ掲載しており、BGP IPv4アドレスファミリーモードのコマンドとしては掲載しておりません。
Note - BGPピア固有の各種設定(neighbor xxxxコマンド)は、原則として該当ピアとの経路交換(neighbor activateコマンド)が有効になっていないと行えません。適宜 neighbor activateコマンドを実行してから設定を行ってください(経路交換の有効化については、こちらを参照)。
awplus(config)# router bgp 65010 ↓ |
awplus(config-router)# bgp router-id 10.10.10.1 ↓ |
awplus(config-router)# redistribute connected ↓ |
awplus(config-router)# network 192.168.10.0/24 ↓ |
awplus(config-router)# neighbor 10.10.10.5 remote-as 65050 ↓ |
Note - 初期設定では、neighbor remote-asコマンドの実行と同時にIPv4経路情報の交換が開始されます。ただし、bgp default ipv4-unicastコマンドをno形式で実行している場合は、BGPモードのneighbor activateコマンドを実行しないとIPv4経路情報の交換が開始されません。
awplus(config)# router bgp 65010 ↓ |
awplus(config-router)# bgp router-id 10.10.10.1 ↓ |
awplus(config-router)# no bgp default ipv4-unicast ↓ |
awplus(config-router)# neighbor 2001:db8:2222:10::5 remote-as 65050 ↓ |
awplus(config-router)# address-family ipv6 ↓ awplus(config-router-af)# redistribute connected ↓ |
awplus(config-router-af)# network 2001:db8:10:10::/64 ↓ |
awplus(config-router-af)# neighbor 2001:db8:2222:10::5 activate ↓ |
Note - 初期設定では、IPv4の経路情報は neighbor remote-asコマンドの実行と同時に交換が開始されますが、IPv6の経路情報は BGP IPv6アドレスファミリーモードでneighbor activateコマンドを実行しないと交換が開始されません。
awplus(config)# router bgp 65010 ↓ |
awplus(config-router)# bgp router-id 10.10.10.1 ↓ |
awplus(config-router)# no bgp default ipv4-unicast ↓ |
awplus(config-router)# neighbor 10.10.10.5 remote-as 65050 ↓ |
awplus(config-router)# redistribute connected ↓ |
awplus(config-router)# network 192.168.10.0/24 ↓ |
awplus(config-router)# neighbor 10.10.10.5 activate ↓ |
Note - 初期設定では、IPv4の経路情報は neighbor remote-asコマンドの実行と同時に交換が開始されますが、本例では手順3で「no bgp default ipv4-unicast」を実行しているため、BGPモードのneighbor activateコマンドを実行するまでIPv4の経路交換は開始されません。
awplus(config-router)# neighbor 2001:db8:2222:10::5 remote-as 65050 ↓ |
awplus(config-router)# address-family ipv6 ↓ awplus(config-router-af)# redistribute connected ↓ |
awplus(config-router-af)# network 2001:db8:10:10::/64 ↓ |
awplus(config-router-af)# neighbor 2001:db8:2222:10::5 activate ↓ |
Note - 初期設定では、IPv4の経路情報は neighbor remote-asコマンドの実行と同時に交換が開始されますが、IPv6の経路情報は BGP IPv6アドレスファミリーモードでneighbor activateコマンドを実行しないと交換が開始されません。
awplus(config)# router bgp 65010 ↓ |
Note - 純粋なIPv6環境では必ずルーターIDを明示的に設定してください。同環境ではインターフェースにIPv4アドレスが設定されていないため、明示的な設定を行わない場合にルーターIDが無効な値となり、BGPセッションを確立できないことがあります。
awplus(config-router)# bgp router-id 10.10.10.1 ↓ |
awplus(config)# interface lo ↓ awplus(config-if)# ip address 10.10.10.1/32 ↓ |
awplus(config-router)# redistribute connected ↓ awplus(config-router)# redistribute static route-map imp_static ↓ |
awplus(config-router)# address-family ipv6 ↓ awplus(config-router-af)# redistribute connected ↓ awplus(config-router-af)# redistribute static route-map imp_static ↓ |
awplus(config-router)# network 172.16.10.0/24 ↓ awplus(config-router)# network 172.16.20.0/24 ↓ |
awplus(config-router)# address-family ipv6 ↓ awplus(config-router-af)# network 2001:db8:10::/48 ↓ awplus(config-router-af)# network 2001:db8:20::/48 ↓ |
awplus(config-router)# aggregate-address 172.16.0.0/16 summary-only ↓ |
awplus(config-router)# address-family ipv6 ↓ awplus(config-router-af)# aggregate-address 2001:db8::/40 summary-only ↓ |
awplus(config-router)# neighbor 10.10.10.5 remote-as 65050 ↓ awplus(config-router)# neighbor 2001:db8:2222:10::5 remote-as 65050 ↓ |
awplus(config-router)# no neighbor 10.10.10.5 activate ↓ awplus(config-router)# neighbor 10.10.10.5 activate ↓ |
awplus(config-router)# address-family ipv6 ↓ awplus(config-router-af)# neighbor 2001:db8:2222:10::5 activate ↓ |
awplus(config-router)# neighbor 10.10.10.5 shutdown ↓ awplus(config-router)# no neighbor 10.10.10.5 shutdown ↓ awplus(config-router)# neighbor 2001:db8:2222:10::5 shutdown ↓ awplus(config-router)# no neighbor 2001:db8:2222:10::5 shutdown ↓ |
awplus(config-router)# neighbor 10.10.10.5 distribute-list AS65050_in ↓ |
awplus(config-router)# address-family ipv6 ↓ awplus(config-router-af)# neighbor 2001:db8:2222:10::5 distribute-list AS65050_in6 ↓ |
Note - BGPピア固有の各種設定(neighbor xxxxコマンド)は、原則として該当ピアとの経路交換(neighbor activateコマンド)が有効になっていないと行えません。適宜 neighbor activateコマンドを実行してから設定を行ってください(経路交換の有効化については、こちらを参照)。
awplus# clear ip bgp 10.10.10.5 soft ↓ |
awplus# clear bgp ipv6 2001:db8:2222:10::5 soft ↓ |
Note - softオプションを付けずに実行すると、BGPセッションがいったん切断されるのでご注意ください(ハードリセット)。softオプションを付けた場合は、BGPセッションを保持したまま経路情報を更新します。詳しくはclear bgp、clear ip bgp、clear bgp ipv6コマンドの説明をご覧ください。
nSess = N × (N - 1) ÷ 2
Note - 本機能はIPv4でのみ使用可能です。
awplus(config)# router bgp 65010 ↓ awplus(config-router)# neighbor 10.10.10.5 remote-as 65010 ↓ awplus(config-router)# neighbor 10.10.10.5 route-reflector-client ↓ |
awplus(config)# router bgp 65010 ↓ awplus(config-router)# neighbor 10.10.10.7 remote-as 65010 ↓ |
Note - ルートリフレクションに対応している必要があるのはRRだけです。RR以外のCP、NCPは通常のiBGPの動作をするだけなので、RRをピアとして指定するときにも特殊な設定は必要ありません。また、CP、NCPは、ルートリフレクションに対応していない機器でもかまいません。
Note - neighbor route-reflector-clientコマンドはiBGPピアに対してのみ有効です。eBGPピアに対して実行した場合はエラーになります。
RR1(config-router)# bgp cluster-id 10.10.10.1 ↓ |
RR2(config-router)# bgp cluster-id 10.10.10.1 ↓ |
awplus> show ip bgp neighbors 10.10.10.5 ↓ BGP neighbor is 10.10.10.5, remote AS 65010, local AS 65010, internal link BGP version 4, remote router ID 10.10.10.5 BGP state = Established, up for 00:02:48 Last read 00:02:48, hold time is 180, keepalive interval is 60 seconds Neighbor capabilities: Route refresh: advertised and received (old and new) Address family IPv4 Unicast: advertised and received Received 13 messages, 0 notifications, 0 in queue Sent 16 messages, 3 notifications, 0 in queue Route refresh request: received 0, sent 2 Minimum time between advertisement runs is 5 seconds For address family: IPv4 Unicast BGP table version 6, neighbor version 6 Index 1, Offset 0, Mask 0x2 Route-Reflector Client Community attribute sent to this neighbor (both) 1 accepted prefixes 10 announced prefixes ... |
Note - 本機能はIPv4でのみ使用可能です。
Note - ASコンフェデレーションを使用する場合は、コンフェデレーション内のすべてのBGPスピーカーにASコンフェデレーションの設定をする必要があります。
awplus(config)# router bgp 65012 ↓ awplus(config-router)# |
awplus(config-router)# bgp confederation identifier 65010 ↓ |
awplus(config-router)# neighbor 10.10.10.2 remote-as 65012 ↓ |
awplus(config-router)# bgp confederation peers 65011 ↓ awplus(config-router)# neighbor 10.10.10.1 remote-as 65011 ↓ |
awplus(config-router)# neighbor 10.10.10.8 remote-as 65080 ↓ |
awplus> show ip bgp neighbors 10.10.10.2 ↓ BGP neighbor is 10.10.10.9, remote AS 65012, local AS 65012, internal link BGP version 4, remote router ID 10.10.10.2 BGP state = Established, up for 00:48:23 ... |
awplus> show ip bgp neighbors 10.10.10.1 ↓ BGP neighbor is 10.10.10.1, remote AS 65011, local AS 65012, external link BGP version 4, remote router ID 10.10.10.1 Neighbor under common administration BGP state = Established, up for 00:45:57 ... |
awplus> show ip bgp neighbors 10.10.10.8 ↓ BGP neighbor is 10.10.10.8, remote AS 65080, local AS 65010, external link BGP version 4, remote router ID 10.10.10.8 BGP state = Established, up for 00:28:07 ... |
awplus> show ip bgp regexp .+ ↓ BGP table version is 67, local router ID is 10.10.10.5 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 172.16.0.0 10.10.10.1 0 100 0 (65011) ? *> 172.22.0.0 10.10.10.1 0 100 0 (65011 65013) i *> 172.23.0.0 10.10.10.8 0 0 65080 i *> 172.24.0.0 10.10.10.8 0 0 65080 65090 i Total number of prefixes 4 |
awplus(config)# router bgp 65010 ↓ awplus(config-router)# neighbor 10.10.10.5 password 41e9re10 ↓ awplus(config-router)# neighbor 2001:db8:2222:10::5 password 1i31twoDa4o ↓ |
Note - 本機能はIPv4でのみ使用可能です。
awplus(config-router)# neighbor 10.10.10.8 remote-as 12345 ↓ awplus(config-router)# neighbor 10.10.10.8 remove-private-as ↓ |
Note - neighbor remove-private-asコマンドはeBGPピアに対してのみ有効です。iBGPピアに対して実行した場合はエラーになります。
awplus> show ip bgp neighbors 10.10.10.8 ↓ |
awplus(config-router)# neighbor INT peer-group ↓ |
awplus(config-router)# neighbor INT remote-as 65010 ↓ |
awplus(config-router)# neighbor INT activate ↓ |
Note - 「no bgp default ipv4-unicast」を設定していない場合、この設定は不要です(実行しても問題ありません)。
awplus(config-router)# address-family ipv6 ↓ awplus(config-router-af)# neighbor INT activate ↓ |
awplus(config-router)# neighbor INT route-map INT_in in ↓ awplus(config-router)# neighbor INT route-map INT_out out ↓ |
awplus(config-router-af)# neighbor INT route-map INT_in in ↓ awplus(config-router-af)# neighbor INT route-map INT_out out ↓ |
Note - 同一ピアグループにIPv4ピアとIPv6ピアを混在させないでください。そのような設定はサポート対象外となります。
awplus(config-router)# neighbor 10.0.0.5 peer-group INT ↓ awplus(config-router)# neighbor 10.0.0.7 peer-group INT ↓ awplus(config-router)# neighbor 10.0.0.8 peer-group INT ↓ |
awplus(config-router-af)# neighbor 2001:db8:2222:10::5 peer-group INT ↓ awplus(config-router-af)# neighbor 2001:db8:2222:10::7 peer-group INT ↓ awplus(config-router-af)# neighbor 2001:db8:2222:10::8 peer-group INT ↓ |
awplus(config-router)# no neighbor 10.0.0.8 peer-group INT ↓ awplus(config-router)# address-family ipv6 ↓ awplus(config-router-af)# no neighbor 2001:db8:2222:10::8 peer-group INT ↓ |
awplus> show ip bgp neighbors 10.0.0.5 ↓ BGP neighbor is 10.0.0.5, remote AS 65010, local AS 65010, internal link Member of peer-group INT for session parameters BGP version 4, remote router ID 10.0.0.5 BGP state = Established, up for 00:03:01 Last read 00:03:01, hold time is 180, keepalive interval is 60 seconds Neighbor capabilities: Route refresh: advertised and received (old and new) Address family IPv4 Unicast: advertised and received Received 7 messages, 0 notifications, 0 in queue Sent 8 messages, 0 notifications, 0 in queue Route refresh request: received 0, sent 0 Minimum time between advertisement runs is 5 seconds Update source is lo For address family: IPv4 Unicast BGP table version 5, neighbor version 5 Index 1, Offset 0, Mask 0x2 INT peer-group member ... |
awplus(config)# bgp nexthop-trigger enable ↓ |
awplus# show running-config bgp ↓ |
awplus# show running-config prefix-list ↓ awplus# show running-config as-path access-list ↓ awplus# show running-config community-list ↓ awplus# show running-config route-map ↓ |
awplus> show ip bgp neighbors ↓ awplus> show ip bgp summary ↓ |
awplus> show bgp ipv6 neighbors ↓ awplus> show bgp ipv6 summary ↓ |
awplus> show ip bgp ↓ |
awplus> show bgp ipv6 ↓ |
awplus> show ip route database ↓ |
awplus> show ipv6 route database ↓ |
awplus> show ip route ↓ |
awplus> show ipv6 route ↓ |
(C) 2015 アライドテレシスホールディングス株式会社
PN: 613-002107 Rev.E