BGPの設定変更をすぐに確認する方法
- カテゴリ:
- Cisco
OSPFやEIGRPと違い、BGPでは設定を変更してもすぐには反映されません。まずこのことを理解しておかないと、設定が反映されないのは間違っているのかもと悩むことになります。そしてこのことを理解していれば、しばらく待ってからshow ip bgpで確認すればいいとなるのですが、CCIE Labの勉強中や試験中では待っていられない場合も当然ながらあります。このような場合、"clear ip bgp"コマンドを利用します。
R2#clear ip bgp ? * Clear all peers 〜略〜 |
最も単純な使い方は"clear ip bgp *"です。
R2#clear ip bgp * R2# Jan 12 06:00:59.871: %BGP-5-ADJCHANGE: neighbor 12.12.12.1 Down User reset Jan 12 06:00:59.871: %BGP-5-ADJCHANGE: neighbor 23.23.23.3 Down User reset Jan 12 06:01:00.915: %BGP-5-ADJCHANGE: neighbor 23.23.23.3 Up Jan 12 06:01:01.107: %BGP-5-ADJCHANGE: neighbor 12.12.12.1 Up |
実行すると分かりますが、これはすべてのBGPセッションのリセットとなります。時間もかかり、あまり効率的な使い方とは言えません。"*"に続けてsoftを指定するとセッションは維持したまま、設定を更新することが出来ます。
R2#clear ip bgp * ? 〜略〜 soft Soft reconfig inbound and outbound updates 〜略〜 R2#clear ip bgp * soft ? in Soft reconfig inbound updates out Soft reconfig outbound updates <cr> |
softに続いてinまたはoutを指定すると片方向のみの更新となります。
下記はネイバー12.12.12.1からのネットワークはweight 100にする実行例です。すぐに結果が反映されたことを確認できます。
R2#show ip bgp BGP table version is 3, local router ID is 17.17.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 *> 172.16.3.0/24 23.23.23.3 0 0 300 i *> 192.168.1.0 12.12.12.1 0 0 100 i R2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R2(config)#router bgp 200 R2(config-router)#neighbor 12.12.12.1 weight 100 R2(config-router)#^Z R2#clear ip bgp * soft in R2#show ip bgp BGP table version is 4, local router ID is 17.17.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 *> 172.16.3.0/24 23.23.23.3 0 0 300 i *> 192.168.1.0 12.12.12.1 0 100 100 i |
"*"を使うと全てのネイバーが対象になります。数が多い場合は特定のネイバーを指定するといいでしょう。
R2#clear ip bgp 12.12.12.1 soft in |
コメント