RTX の BGP 設定
基本設定
直接接続しているネットワークを広告
ip loopback1 address 192.168.100.101/24 ip loopback2 address 192.168.200.101/24 bgp use on bgp autonomous-system 65000 bgp neighbor 1 65000 10.1.1.2 bgp router id 192.168.1.101 bgp import filter 1 include 192.168.100.0/24 192.168.200.0/24 bgp import 65000 static filter 1 ← Direct Connect Network の広告時も必須 bgp configure refresh ←設定反映コマンド
確認コマンド
Neighbor 状態確認
# show status bgp neighbor 10.1.1.2 BGP neighbor is 10.1.1.2, remote AS 65000, local AS 65000, internal link BGP version 4, remote router ID 2.2.2.2 BGP state = Established, up for 00:02:30 Last read 00:00:46, hold time is 180, keepalive interval is 60 seconds Received 6 messages, 0 notifications, 0 in queue Sent 8 messages, 0 notifications, 0 in queue Connection established 1; dropped 0 Last reset never Local host: 10.1.1.1, Local port: 179 Foreign host: 10.1.1.2, Foreign port: 61702
広告ルートの確認
# show status bgp neighbor 10.1.1.2 advertised-routes Total routes: 4 *: valid route Network Next Hop Metric LocPrf Path * 192.168.100.0/24 10.1.1.1 100 IGP * 192.168.200.0/24 10.1.1.1 100 IGP
受信ルートの確認
# show status bgp neighbor 10.1.1.2 received-routes Total routes: 2 *: valid route Network Next Hop Metric LocPrf Path * 2.2.2.0/24 10.1.1.2 0 100 IGP * 1.1.1.0/24 10.1.1.2 0 100 IGP
広告ルートのフィルタ設定
192.168.100.0/24 のみ広告する設定
ip loopback1 address 192.168.100.101/24 ip loopback2 address 192.168.200.101/24 bgp use on bgp autonomous-system 65000 bgp neighbor 1 65000 10.1.1.2 bgp router id 192.168.1.101 bgp import filter 1 include 192.168.100.0/24 ←広告したいルートのみ指定する。 bgp import 65000 static filter 1 bgp configure refresh
確認コマンド
広告ルートの確認
# show status bgp neighbor 10.1.1.2 advertised-routes Total routes: 1 *: valid route Network Next Hop Metric LocPrf Path * 192.168.100.0/24 10.1.1.1 100 IGP
受信ルートのフィルタ設定
1.1.1.0/24 のみ受信する設定
ip loopback1 address 192.168.100.101/24 ip loopback2 address 192.168.200.101/24 bgp use on bgp autonomous-system 65000 bgp neighbor 1 65000 10.1.1.2 bgp router id 192.168.1.101 bgp import filter 1 include 192.168.100.0/24 bgp import 65000 static filter 1 bgp export filter 1 include 1.1.1.0/24 bgp export 65000 filter 1 bgp configure refresh
確認コマンド
受信ルートの確認
# show status bgp neighbor 10.1.1.2 received-routes Total routes: 2 *: valid route Network Next Hop Metric LocPrf Path 2.2.2.0/24 10.1.1.2 0 100 IGP ← BGP テーブルにはのるが有効ルートとならない。 * 1.1.1.0/24 10.1.1.2 0 100 IGP
Ciscoの BGP 設定
基本設定
直接接続しているネットワークを広告
router bgp 65000 bgp log-neighbor-changes neighbor 10.1.1.1 remote-as 65000 ! address-family ipv4 network 1.1.1.0 mask 255.255.255.0 network 2.2.2.0 mask 255.255.255.0 neighbor 10.1.1.1 activate neighbor 10.1.1.1 soft-reconfiguration inbound exit-address-family
確認コマンド
Neighbor 状態確認
Router#sh ip bgp summary BGP router identifier 2.2.2.2, local AS number 65000 BGP table version is 104, main routing table version 104 3 network entries using 744 bytes of memory 3 path entries using 360 bytes of memory 2/2 BGP path/bestpath attribute entries using 480 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 1584 total bytes of memory BGP activity 32/29 prefixes, 54/51 paths, scan interval 60 secs Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 10.1.1.1 4 65000 73 80 104 0 0 01:09:29
広告ルートの確認
Router#sh ip bgp neighbors 10.1.1.1 advertised-routes BGP table version is 104, 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, 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.0/24 0.0.0.0 0 32768 i *> 2.2.2.0/24 0.0.0.0 0 32768 i Total number of prefixes 2
受信ルートの確認
Router#sh ip bgp neighbors 10.1.1.1 received-routes BGP table version is 106, 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, 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 192.168.100.0 10.1.1.1 100 0 i Total number of prefixes 1