このページで解説している内容は、以下の YouTube 動画の解説で見ることができます。
【L3SW】BGPのベストパスの確認
「【L3SW】OSPFv2の設定①」の続きです。
ここでは、L3スイッチを用いたネットワークに設定したBGPを検証していきます。
ネットワークの構成は下図のとおりです。

ルーティングテーブルの確認
各L3スイッチで「show ip route」コマンドを実行し、BGPルートがあることを確認します。
●L3SW1のルーティングテーブル
L3SW1#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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
C 172.16.0.0/16 is directly connected, GigabitEthernet1/0/1
C 172.17.0.0/16 is directly connected, GigabitEthernet1/0/2
B 172.18.0.0/16 [20/0] via 172.17.0.1, 00:00:00
●L3SW2のルーティングテーブル
L3SW2#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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
B 172.16.0.0/16 [20/0] via 172.17.0.2, 00:00:00
C 172.17.0.0/16 is directly connected, GigabitEthernet1/0/1
C 172.18.0.0/16 is directly connected, GigabitEthernet1/0/2
上の黄色のマークに注目します。
L3SW1には、BGPのルート「172.18.0.0/16」のルートがあります。
L3SW2には、BGPのルート「172.16.0.0」のルートがあります。
ベストパスの確認
BGPテーブルを確認してみます。BGPテーブルの内容を確認するには、「show ip bgp」コマンドを使用します。
●L3SW1のBGPテーブル
L3SW1#show ip bgp
BGP table version is 5, local router ID is 172.17.0.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
*> 172.16.0.0/16 0.0.0.0 0 0 32768 i
*> 172.18.0.0/16 172.17.0.1 0 0 0 200 i
AS200内の「172.18.0.0/16」の経路情報があります。
「*」は、その経路情報が有効であることを示しており、「>」は、ベストパスであることを示しています。
●L3SW2のBGPテーブル
L3SW2#show ip bgp
BGP table version is 5, local router ID is 172.18.0.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
*> 172.16.0.0/16 172.17.0.2 0 0 0 100 i
*> 172.18.0.0/16 0.0.0.0 0 0 32768 i
AS100内の「172.16.0.0/16」の経路情報があります。
「*」は、その経路情報が有効であることを示しており、「>」は、ベストパスであることを示しています。
近接ルータの詳細情報を確認する
ピア接続について、さらに詳細情報を確認したい場合には、「show ip bgp neighbors」コマンドを使用します。
L3SW1で出力を確認します。
L3SW1#show ip bgp neighbors
BGP neighbor is 172.17.0.1, remote AS 200, external link
BGP version 4, remote router ID 172.18.0.1
BGP state = Established, up for 01:06:08
Last read 01:06:08, last write 01:06:08, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(new)
Address family IPv4 Unicast: advertised and received
Message statistics:
InQ depth is 0
OutQ depth is 0
Sent Rcvd
Opens: 2 2
Notifications: 1 1
Updates: 2 2
Keepalives: 71 71
Route Refresh: 0 0
Total: 76 76
Default minimum time between advertisements runs is 30 seconds
For address family: IPv4 Unicast
BGP table version 5, neighbor version 6/0
Output queue size : 0
Index 1, Offset 0, Mask 0x2
1 update-group member
Sent Rcvd
Prefix activity: ---- ----
Prefixes Current: 1 1 (Consumes 46 bytes)
Prefixes total: 1 1
Implicit Withdraw: 0 0
Explicit Withdraw: 0 0
Used as bestpath: n/a 1
Used as multipath: n/a 0
Outbound Inbound
Local Policy Denied Prefixes: -------- -------
Total: 0 0
Number of NLRIs in the update sent: max 3, min 1
Address tracking is enabled, the RIB does have a route to 172.17.0.1
Connections established 2; dropped 1
Last reset never
Transport(tcp) path-mtu-discovery is enabled
Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Connection is ECN Disabled, Minimum incoming TTL 0, Outgoing TTL 1
Local host: 172.17.0.2, Local port: 179
Foreign host: 172.17.0.1, Foreign port: 1026
Connection tableid (VRF): 0
Enqueued packets for retransmit: 0, input: 0 mis-ordered: 0 (0 bytes)
Event Timers (current time is 0xC69F4):
Timer Starts Wakeups Next
Retrans 0 0 0x0
TimeWait 0 0 0x0
AckHold 73 0 0x0
SendWnd 0 0 0x0
KeepAlive 71 0 0x0
GiveUp 0 0 0x0
PmtuAger 0 0 0x0
DeadWait 0 0 0x0
Linger 0 0 0x0
ProcessQ 0 0 0x0
iss: 2057115318 snduna: 2057115748 sndnxt: 2057115748 sndwnd: 15955
irs: 3480424370 rcvnxt: 3480424751 rcvwnd: 16004 delrcvwnd: 380
SRTT: 259 ms, RTTO: 579 ms, RTV: 320 ms, KRTT: 0 ms
minRTT: 16 ms, maxRTT: 300 ms, ACK hold: 200 ms
Status Flags: passive open, gen tcbs
Option Flags: nagle, path mtu capable
IP Precedence value : 6
Datagrams (max data segment is 1460 bytes):
Rcvd: 76 (out of order: 0), with data: 0, total data bytes: 0
Sent: 75 (retransmit: 0, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 2, total data bytes: 48
Packets received in fast path: 0, fast processed: 0, slow path: 0
fast lock acquisition failures: 0, slow path: 0
経路情報を送受信していることが確認できます。
疎通確認
PC1からPC2へpingを行います。
C:>ping 172.18.0.10

pingは成功します。
L3スイッチにおいてもルータと同様にBGPが定義できることが確認できました。
これで動作検証は終わりです。
