H O M E > ネットワークのおべんきょしませんか? Cisco CCNA/CCNP/CCIE、ネットワークスペシャリスト試験の勉強にピッタリ > 2012年9月
(所属カテゴリー:IPルーティング | シスコ---投稿日時:2012年9月28日)
R1~R4でAS番号を指定してBGPプロセスを有効化します。BGPプロセスが動作するためにはBGPルータIDが必要です。デフォルトでは、BGPルータIDはOSPFと同様にルータのIPv4アドレスをもとに決められます。R1~R4はIPv4アドレスを持たないため、BGPルータIDを決められなくなってしまいます。そこで、BGPプロセスを動作させるために、R1~R4でBGPルータIDをスタティックに設定します。次の表に、各ルータのAS番号とルータIDをまとめています。
また、各ルータでIPv4プレフィクスを扱わないようにno bgp default ipv4-unicastを設定します。
R1
---------------------------------------------------------------------- router bgp 65123 bgp router-id 1.1.1.1 no bgp default ipv4-unicast ----------------------------------------------------------------------
R2
---------------------------------------------------------------------- router bgp 65123 bgp router-id 2.2.2.2 no bgp default ipv4-unicast ----------------------------------------------------------------------
R3
---------------------------------------------------------------------- router bgp 65123 bgp router-id 3.3.3.3 no bgp default ipv4-unicast ----------------------------------------------------------------------
R4
---------------------------------------------------------------------- router bgp 65004 bgp router-id 4.4.4.4 no bgp default ipv4-unicast ----------------------------------------------------------------------
AS65123のR1~R3でIBGPネイバーを設定します。IBGPネイバーはLoopback0のIPv6アドレス 2001:123:123:X:X::X (X=ルータ番号)を利用してフルメッシュで確立します。
router bgp直下でネイバーを指定し、IPv6プレフィクスを扱えるようにaddress-family ipv6の中でネイバーをactivateします。
R1
---------------------------------------------------------------------- router bgp 65123 neighbor 2001:123:2:2::2 remote-as 65123 neighbor 2001:123:2:2::2 update-source Loopback0 neighbor 2001:123:3:3::3 remote-as 65123 neighbor 2001:123:3:3::3 update-source Loopback0 ! address-family ipv6 neighbor 2001:123:2:2::2 activate neighbor 2001:123:3:3::3 activate ----------------------------------------------------------------------
R2
---------------------------------------------------------------------- router bgp 65123 neighbor 2001:123:1:1::1 remote-as 65123 neighbor 2001:123:1:1::1 update-source Loopback0 neighbor 2001:123:3:3::3 remote-as 65123 neighbor 2001:123:3:3::3 update-source Loopback0 ! address-family ipv6 neighbor 2001:123:1:1::1 activate neighbor 2001:123:3:3::3 activate ----------------------------------------------------------------------
R3
---------------------------------------------------------------------- router bgp 65123 neighbor 2001:123:1:1::1 remote-as 65123 neighbor 2001:123:1:1::1 update-source Loopback0 neighbor 2001:123:2:2::2 remote-as 65123 neighbor 2001:123:2:2::2 update-source Loopback0 ! address-family ipv6 neighbor 2001:123:1:1::1 activate neighbor 2001:123:2:2::2 activate ----------------------------------------------------------------------
R1~R3間のIBGPネイバーを確認します。そのために、以下のコマンドを実行します。
R1でのshowコマンドの出力は次のようになります。
R1
---------------------------------------------------------------------- R1#show bgp ipv6 unicast summary BGP router identifier 1.1.1.1, local AS number 65123 BGP table version is 1, main routing table version 1 Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 2001:123:2:2::2 4 65123 13 13 1 0 0 00:09:34 0 2001:123:3:3::3 4 65123 12 12 1 0 0 00:08:42 0 R1#show bgp ipv6 unicast neighbors BGP neighbor is 2001:123:2:2::2, remote AS 65123, internal link BGP version 4, remote router ID 2.2.2.2 BGP state = Established, up for 00:00:10 Last read 00:00:10, last write 00:00:10, hold time is 180, keepalive interval is 60 seconds Neighbor capabilities: Route refresh: advertised and received(old & new) Address family IPv6 Unicast: advertised and received ~省略~ BGP neighbor is 2001:123:3:3::3, remote AS 65123, internal link BGP version 4, remote router ID 3.3.3.3 BGP state = Established, up for 00:00:06 Last read 00:00:06, last write 00:00:06, hold time is 180, keepalive interval is 60 seconds Neighbor capabilities: Route refresh: advertised and received(old & new) Address family IPv6 Unicast: advertised and received ~省略~ ----------------------------------------------------------------------
次の図は、AS65123のIBGPネイバーをまとめたものです。
AS65123のR2でIPv6 BGPプレフィクス 2001:123:123:2::/64を生成します。R2でaddress-family ipv6の中でnetworkコマンドを利用します。
R2
---------------------------------------------------------------------- router bgp 65123 address-family ipv6 network 2001:123:123:2::/64 ----------------------------------------------------------------------
networkコマンドで生成したIPv6 BGPプレフィクスはIBGPネイバーへとアドバタイズされます。
Step4で生成したIPv6 BGPプレフィクスがAS65123内で正常にアドバタイズされていることを確認します。そのために、以下のコマンドを利用します。
R2ではshowコマンドの出力は次のようになります。
R2
---------------------------------------------------------------------- R2#show bgp ipv6 unicast BGP table version is 2, local router ID is 2.2.2.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 *> 2001:123:123:2::/64 :: 0 32768 i R2#show bgp ipv6 unicast neighbors 2001:123:1:1::1 advertised-routes BGP table version is 2, local router ID is 2.2.2.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 *> 2001:123:123:2::/64 :: 0 32768 i Total number of prefixes 1 R2#show bgp ipv6 unicast neighbors 2001:123:3:3::3 advertised-routes BGP table version is 2, local router ID is 2.2.2.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 *> 2001:123:123:2::/64 :: 0 32768 i Total number of prefixes 1 ----------------------------------------------------------------------
次の図はAS65123内でのIPv6 BGPプレフィクスのアドバタイズの様子を表しています。
図 3 IPv6 BGPプレフィクスのアドバタイズ(AS65123内)
AS65123とAS65004間でEBGPネイバーを設定します。ネイバーを確立するIPv6アドレスは物理インタフェースのものを利用します。
R1
---------------------------------------------------------------------- router bgp 65123 neighbor 2001:14:14:14::4 remote-as 65004 ! address-family ipv6 neighbor 2001:14:14:14::4 activate ----------------------------------------------------------------------
R3
---------------------------------------------------------------------- router bgp 65123 neighbor 2001:34:34:34::4 remote-as 65004 ! address-family ipv6 neighbor 2001:34:34:34::4 activate ----------------------------------------------------------------------
R4
---------------------------------------------------------------------- router bgp 65004 neighbor 2001:14:14:14::1 remote-as 65123 neighbor 2001:34:34:34::3 remote-as 65123 ! address-family ipv6 neighbor 2001:14:14:14::1 activate neighbor 2001:34:34:34::3 activate ----------------------------------------------------------------------
EBGPネイバーが正しく確立できていることを確認します。R4でshow bgp ipv6 summaryコマンドを見ると、次のようになります。
R4
---------------------------------------------------------------------- R4#show bgp ipv6 unicast summary BGP router identifier 4.4.4.4, local AS number 65004 BGP table version is 2, main routing table version 2 1 network entries using 149 bytes of memory 2 path entries using 152 bytes of memory 2/1 BGP path/bestpath attribute entries using 248 bytes of memory 1 BGP AS-PATH entries using 24 bytes of memory 0 BGP route-map cache entries using 0 bytes of memory 0 BGP filter-list cache entries using 0 bytes of memory BGP using 573 total bytes of memory BGP activity 1/0 prefixes, 2/0 paths, scan interval 60 secs Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 2001:14:14:14::1 4 65123 9 9 2 0 0 00:04:03 1 2001:34:34:34::3 4 65123 9 9 2 0 0 00:04:00 1 ----------------------------------------------------------------------
EBGPネイバーが正常に確立できていれば、R4でAS65123内の2001:123:123:2::/64のプレフィクスを確認できます。R4でIPv6 BGPテーブルを見ると、次のようになります。
R4
---------------------------------------------------------------------- R4#show bgp ipv6 unicast BGP table version is 2, 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 Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path * 2001:123:123:2::/64 2001:34:34:34::3 0 65123 i *> 2001:14:14:14::1 0 65123 i ----------------------------------------------------------------------
AS65004のR4でIPv6 BGPプレフィクス 2001:4:4:4::/64を生成します。R4でaddress-family ipv6の中でnetworkコマンドを利用します。
R4
---------------------------------------------------------------------- router bgp 65004 address-family ipv6 network 2001:4:4:4::/64 ----------------------------------------------------------------------
networkコマンドで生成したIPv6 BGPプレフィクスはAS65123へとアドバタイズされます。R1、R3でIPv6 BGPテーブルを確認すると、次のようになります。
R1
---------------------------------------------------------------------- R1#show bgp ipv6 unicast BGP table version is 3, local router ID is 1.1.1.1 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 * i2001:4:4:4::/64 2001:34:34:34::4 0 100 0 65004 i *> 2001:14:14:14::4 0 0 65004 i *>i2001:123:123:2::/64 2001:123:2:2::2 0 100 0 i ----------------------------------------------------------------------
R3
---------------------------------------------------------------------- R3#show bgp ipv6 unicast BGP table version is 3, local router ID is 3.3.3.3 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 * i2001:4:4:4::/64 2001:14:14:14::4 0 100 0 65004 i *> 2001:34:34:34::4 0 0 65004 i *>i2001:123:123:2::/64 2001:123:2:2::2 0 100 0 i ----------------------------------------------------------------------
しかし、R2でIPv6 BGPテーブルを確認すると、プレフィクス2001:4:4:4::/64を受信しているもののベストパスとなっていません。
R2
---------------------------------------------------------------------- R2#show bgp ipv6 unicast BGP table version is 2, local router ID is 2.2.2.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 * i2001:4:4:4::/64 2001:14:14:14::4 0 100 0 65004 i * i 2001:34:34:34::4 0 100 0 65004 i *> 2001:123:123:2::/64 :: 0 32768 i R2#show bgp ipv6 unicast 2001:4:4:4::/64 BGP routing table entry for 2001:4:4:4::/64, version 0 Paths: (2 available, no best path) Not advertised to any peer 65004 2001:14:14:14::4 (inaccessible) from 2001:123:1:1::1 (1.1.1.1) Origin IGP, metric 0, localpref 100, valid, internal 65004 2001:34:34:34::4 (inaccessible) from 2001:123:3:3::3 (3.3.3.3) Origin IGP, metric 0, localpref 100, valid, internal ----------------------------------------------------------------------
次の図は、AS65004の2001:4:4:4::/64がアドバタイズされる様子を表していま す。
図 5 AS65004のIPv6 BGPプレフィクスのアドバタイズ
※図では、R1-R3間の2001:4:4:4::/64のアドバタイズは省略しています。
R2で2001:4:4:4::/64が無効なプレフィクスになってしまっている理由は、ネクストホップへの接続性がないためです。R2は2001:14:14:14::4および2001:34:34:34::4への接続性がないので、これらのIPv6アドレスがネクストホップとなっているIPv6プレフィクスを利用することができません。
R2での2001:4:4:4::/64のネクストホップへの接続性を確保するために、R1とR3でnext-hop-selfの設定を行います。IPv6プレフィクスに対するnext-hop-selfの設定は、address-family ipv6の中でコマンドを入力します。
R1
---------------------------------------------------------------------- router bgp 65123 address-family ipv6 neighbor 2001:123:2:2::2 next-hop-self neighbor 2001:123:3:3::3 next-hop-self ----------------------------------------------------------------------
R3
---------------------------------------------------------------------- router bgp 65123 address-family ipv6 neighbor 2001:123:2:2::2 next-hop-self neighbor 2001:123:1:1::1 next-hop-self ----------------------------------------------------------------------
R2でnext-hop-selfによって2001:4:4:4::/64のネクストホップへの接続性を確保できていることを確認します。
R2
---------------------------------------------------------------------- R2#show bgp ipv6 unicast 2001:4:4:4::/64 BGP routing table entry for 2001:4:4:4::/64, version 3 Paths: (2 available, best #1, table Global-IPv6-Table) Not advertised to any peer 65004 2001:123:1:1::1 (metric 10) from 2001:123:1:1::1 (1.1.1.1) Origin IGP, metric 0, localpref 100, valid, internal, best 65004 2001:123:3:3::3 (metric 10) from 2001:123:3:3::3 (3.3.3.3) Origin IGP, metric 0, localpref 100, valid, internal ----------------------------------------------------------------------
R1、R3のnext-hop-selfによって、2001:4:4:4::/64のネクストホップアドレスがR2から接続性のある2001:123:1:1:1::/64、2001:123:3:3::/64に変更されています。そして、ベストパスがR1経由のプレフィクスとなっていることがわかります。なお、この場合のベストパスの選択はルータIDに基いて行われています。
次の図は、next-hop-selfの設定を行った場合2001:4:4:4::/64のアドバタイズの様子を表しています。
図 AS65004のIPv6 BGPプレフィクスのアドバタイズ
※図では、R1-R3間の2001:4:4:4::/64のアドバタイズは省略しています。
AS65123の2001:123:123:2::/64とAS65004の2001:4:4:4::/64間の通信が正しく行えることを確認します。
R2
---------------------------------------------------------------------- R2#ping 2001:4:4:4::4 source 2001:123:123:2::2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2001:4:4:4::4, timeout is 2 seconds: Packet sent with a source address of 2001:123:123:2::2 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 48/67/108 ms ----------------------------------------------------------------------
※送信元IPv6アドレスを指定しなければPingの応答は返ってきません。