Mikan Network Lab.

ネットワーク技術やCisco製品に関して、勉強・検証した内容を発信しています。

Mikan Network Lab.

IOS-XRにおけるBGPタイマーの設定方法

Cisco IOS-XRにおけるBGPタイマー(キープアライブタイマー、ホールドタイマー)の設定方法を紹介します。

目次

1. コマンド一覧
2. 仕様説明
 2.1. 概要
 2.2. timers bgp
 2.3. timers
3. 設定例
 3.1. 要件
 3.2. コンフィグ
 3.3. 解説
 3.4. 動作確認
  3.4.1. show bgp ipv4 unicast neighbors

前提条件

本記事は以下に基づいて作成しています。
・Cisco VIRL 1.6.65
・Cisco IOS XR Software, Version 6.1.3

1. コマンド一覧

本記事で重要なコマンドを以下に示します。

(config)# router bgp <as-number>
(config-bgp)# timers bgp <keepalive> <hold-time>
(config-bgp)# neighbor <ip-address>
(config-bgp-nbr)# timers <keepalive> <hold-time>

2. 仕様説明

2.1. 概要

BGPでは定期的にKeepaliveメッセージを送信し、ネイバーがダウンしたかどうかを確認しています。デフォルトではKeepaliveメッセージは60秒ごとに送信され、ホールドタイマーの180秒以内にKeepaliveメッセージを受信できなかった場合、ネイバーがダウンしたとみなします。デフォルトのタイマー値(キープアライブタイマー、ホールドタイマー)を変更したい場合は、timers bgpコマンドまたはtimersコマンドを使用します。

2.2. timers bgp

全てのBGPネイバーで使用されているキープアライブタイマー、ホールドタイマーの時間を変更するには、ルータコンフィギュレーションモードでtimers bgpコマンドを使用します。

(config-bgp)# timers bgp <keepalive> <hold-time>

<keepalive>でKeepaliveメッセージの送信間隔を指定します。単位は秒です。デフォルトは60秒です。

<hold-time>でKeepaliveメッセージを受信しなくなってからネイバーがダウンしたとみなすまでの時間を指定します。単位は秒です。デフォルトは180秒です。

2.3. timers

特定のBGPネイバーで使用されているキープアライブタイマー、ホールドタイマーの時間を変更するには、ネイバーコンフィギュレーションモードでtimersコマンドを使用します。

(config-bgp-nbr)# timers <keepalive> <hold-time>

<keepalive>でKeepaliveメッセージの送信間隔を指定します。単位は秒です。デフォルトは60秒です。

<hold-time>でKeepaliveメッセージを受信しなくなってからネイバーがダウンしたとみなすまでの時間を指定します。単位は秒です。デフォルトは180秒です。

特定のネイバーでtimersコマンドを使用して設定した値は、ルータコンフィギュレーションモードでtimers bgpコマンドを使用して設定した値を上書きできます。

3. 設定例

3.1. 要件

  • XR1のBGPプロセスをAS番号65001で起動してください。
  • XR2とXR3のBGPプロセスをAS番号65002で起動してください。
  • XR1とXR2との間ではキープアライブタイマーを30秒、ホールドタイマーを90秒に設定してください。ただし、ネイバー単位で指定してください。
  • XR2とXR3との間ではキープアライブタイマーを40秒、ホールドタイマーを120秒に設定してください。ただし、ネイバー単位で指定してはいけません。

構成図

3.2. コンフィグ

本タスクの要件を満たす設定例を以下に示します。

 XR1 

hostname XR1
interface Loopback0
 ipv4 address 1.1.1.1 255.255.255.255
!
interface GigabitEthernet0/0/0/0
 ipv4 address 192.168.12.1 255.255.255.0
!
route-policy RPL
  pass
end-policy
!
router bgp 65001
 address-family ipv4 unicast
 !
 neighbor 192.168.12.2
  remote-as 65002
  timers 30 90
  address-family ipv4 unicast
   route-policy RPL in
   route-policy RPL out
  !
 !
!
end

 XR2 

hostname XR2
interface Loopback0
 ipv4 address 2.2.2.2 255.255.255.255
!
interface GigabitEthernet0/0/0/0
 ipv4 address 192.168.12.2 255.255.255.0
!
interface GigabitEthernet0/0/0/1
 ipv4 address 192.168.23.2 255.255.255.0
!
route-policy RPL
  pass
end-policy
!
router bgp 65002
 timers bgp 40 120
 address-family ipv4 unicast
 !
 neighbor 192.168.12.1
  remote-as 65001
  timers 30 90
  address-family ipv4 unicast
   route-policy RPL in
   route-policy RPL out
  !
 !
 neighbor 192.168.23.3
  remote-as 65002
  address-family ipv4 unicast
  !
 !
!
end

 XR3 

hostname XR3
interface Loopback0
 ipv4 address 3.3.3.3 255.255.255.255
!
interface GigabitEthernet0/0/0/0
 ipv4 address 192.168.23.3 255.255.255.0
!
router bgp 65002
 timers bgp 40 120
 address-family ipv4 unicast
 !
 neighbor 192.168.23.2
  remote-as 65002
  address-family ipv4 unicast
  !
 !
!
end

3.3. 解説

本タスクの設定例のポイントを以下に示します。

  • XR1とXR2との間ではキープアライブタイマーとホールドタイマーをネイバー単位で指定することが要求されているため、ネイバーコンフィギュレーションモードでtimersコマンドを使用しています。
  • XR2とXR3との間ではキープアライブタイマーとホールドタイマーをネイバー単位で指定してはいけないことが要求されているため、ルータコンフィギュレーションモードでtimers bgpコマンドを使用しています。
  • XR2ではXR1とのネイバーでtimersコマンドを使用し、timers bgpコマンドの設定値を上書きしています。

3.4. 動作確認

3.4.1. show bgp ipv4 unicast summary

  • XR1とXR2との間ではキープアライブタイマーが30秒、ホールドタイマーが90秒となっていること。
  • XR2とXR3との間ではキープアライブタイマーが40秒、ホールドタイマーが120秒となっていること。

RP/0/0/CPU0:XR1#show bgp ipv4 unicast neighbors
Sat Mar 14 05:12:23.317 UTC

BGP neighbor is 192.168.12.2
 Remote AS 65002, local AS 65001, external link
 Remote router ID 2.2.2.2
  BGP state = Established, up for 00:25:08
  NSR State: None
  Last read 00:00:02, Last read before reset 00:25:41
  Hold time is 90, keepalive interval is 30 seconds
  Configured hold time: 90, keepalive: 30, min acceptable hold time: 3
  Last write 00:00:02, attempted 19, written 19
  Second last write 00:00:32, attempted 19, written 19
  Last write before reset 00:25:50, attempted 19, written 19
  Second last write before reset 00:26:20, attempted 19, written 19
  Last write pulse rcvd  Mar 14 05:12:21.247 last full not set pulse count 144
  Last write pulse rcvd before reset 00:25:50
  Socket not armed for io, armed for read, armed for write
  Last write thread event before reset 00:25:50, second last 00:25:50
  Last KA expiry before reset 00:25:50, second last 00:26:20
  Last KA error before reset 00:00:00, KA not sent 00:00:00
  Last KA start before reset 00:25:50, second last 00:26:20
  Precedence: internet
  Non-stop routing is enabled
  Enforcing first AS is enabled
  Multi-protocol capability received
  Neighbor capabilities:
    Route refresh: advertised (old + new) and received (old + new)
    4-byte AS: advertised and received
    Address family IPv4 Unicast: advertised and received
  Received 73 messages, 1 notifications, 0 in queue
  Sent 72 messages, 0 notifications, 0 in queue
  Minimum time between advertisement runs is 30 secs
  Inbound message logging enabled, 3 messages buffered
  Outbound message logging enabled, 3 messages buffered

 For Address Family: IPv4 Unicast
  BGP neighbor version 2
  Update group: 0.2 Filter-group: 0.1  No Refresh request being processed
  Route refresh request: received 0, sent 0
  Policy for incoming advertisements is RPL
  Policy for outgoing advertisements is RPL
  0 accepted prefixes, 0 are bestpaths
  Cumulative no. of prefixes denied: 0.
  Prefix advertised 0, suppressed 0, withdrawn 0
  Maximum prefixes allowed 1048576
  Threshold for warning message 75%, restart interval 0 min
  An EoR was received during read-only mode
  Last ack version 2, Last synced ack version 0
  Outstanding version objects: current 0, max 0
  Additional-paths operation: None

  Connections established 3; dropped 2
  Local host: 192.168.12.1, Local port: 45466, IF Handle: 0x00000040
  Foreign host: 192.168.12.2, Foreign port: 179
  Last reset 00:25:41, due to BGP Notification received: administrative reset
  Time since last notification received from neighbor: 00:25:41
  Error Code: administrative reset
  Notification data received:
    None
RP/0/0/CPU0:XR2#show bgp ipv4 unicast neighbors
Sat Mar 14 05:20:34.563 UTC

BGP neighbor is 192.168.12.1
 Remote AS 65001, local AS 65002, external link
 Remote router ID 1.1.1.1
  BGP state = Established, up for 00:33:19
  NSR State: None
  Last read 00:00:13, Last read before reset 00:34:02
  Hold time is 90, keepalive interval is 30 seconds
  Configured hold time: 90, keepalive: 30, min acceptable hold time: 3
  Last write 00:00:13, attempted 19, written 19
  Second last write 00:00:43, attempted 19, written 19
  Last write before reset 00:34:02, attempted 19, written 19
  Second last write before reset 00:34:32, attempted 19, written 19
  Last write pulse rcvd  Mar 14 05:20:21.464 last full not set pulse count 178
  Last write pulse rcvd before reset 00:34:02
  Socket not armed for io, armed for read, armed for write
  Last write thread event before reset 00:34:02, second last 00:34:02
  Last KA expiry before reset 00:34:02, second last 00:34:32
  Last KA error before reset 00:00:00, KA not sent 00:00:00
  Last KA start before reset 00:34:02, second last 00:34:32
  Precedence: internet
  Non-stop routing is enabled
  Enforcing first AS is enabled
  Multi-protocol capability received
  Neighbor capabilities:
    Route refresh: advertised (old + new) and received (old + new)
    4-byte AS: advertised and received
    Address family IPv4 Unicast: advertised and received
  Received 88 messages, 0 notifications, 0 in queue
  Sent 91 messages, 1 notifications, 0 in queue
  Minimum time between advertisement runs is 30 secs
  Inbound message logging enabled, 3 messages buffered
  Outbound message logging enabled, 3 messages buffered

 For Address Family: IPv4 Unicast
  BGP neighbor version 2
  Update group: 0.2 Filter-group: 0.2  No Refresh request being processed
  Route refresh request: received 0, sent 0
  Policy for incoming advertisements is RPL
  Policy for outgoing advertisements is RPL
  0 accepted prefixes, 0 are bestpaths
  Cumulative no. of prefixes denied: 0.
  Prefix advertised 0, suppressed 0, withdrawn 0
  Maximum prefixes allowed 1048576
  Threshold for warning message 75%, restart interval 0 min
  An EoR was received during read-only mode
  Last ack version 2, Last synced ack version 0
  Outstanding version objects: current 0, max 0
  Additional-paths operation: None

  Connections established 3; dropped 2
  Local host: 192.168.12.2, Local port: 179, IF Handle: 0x00000020
  Foreign host: 192.168.12.1, Foreign port: 45466
  Last reset 00:33:52, due to Peer closing down the session
  Peer reset reason: Remote closed the session (Connection timed out)
  Time since last notification sent to neighbor: 00:33:53
  Error Code: administrative reset
  Notification data sent:
    None

BGP neighbor is 192.168.23.3
 Remote AS 65002, local AS 65002, internal link
 Remote router ID 3.3.3.3
  BGP state = Established, up for 00:33:32
  NSR State: None
  Last read 00:00:06, Last read before reset 00:34:13
  Hold time is 120, keepalive interval is 40 seconds
  Configured hold time: 120, keepalive: 40, min acceptable hold time: 3
  Last write 00:00:06, attempted 19, written 19
  Second last write 00:00:46, attempted 19, written 19
  Last write before reset 00:34:13, attempted 19, written 19
  Second last write before reset 00:35:13, attempted 19, written 19
  Last write pulse rcvd  Mar 14 05:20:27.914 last full not set pulse count 142
  Last write pulse rcvd before reset 00:34:13
  Socket not armed for io, armed for read, armed for write
  Last write thread event before reset 00:34:02, second last 00:34:02
  Last KA expiry before reset 00:34:13, second last 00:35:13
  Last KA error before reset 00:00:00, KA not sent 00:00:00
  Last KA start before reset 00:34:13, second last 00:35:13
  Precedence: internet
  Non-stop routing is enabled
  Multi-protocol capability received
  Neighbor capabilities:
    Route refresh: advertised (old + new) and received (old + new)
    4-byte AS: advertised and received
    Address family IPv4 Unicast: advertised and received
  Received 71 messages, 1 notifications, 0 in queue
  Sent 74 messages, 7 notifications, 0 in queue
  Minimum time between advertisement runs is 0 secs
  Inbound message logging enabled, 3 messages buffered
  Outbound message logging enabled, 3 messages buffered

 For Address Family: IPv4 Unicast
  BGP neighbor version 2
  Update group: 0.1 Filter-group: 0.1  No Refresh request being processed
  Route refresh request: received 0, sent 0
  0 accepted prefixes, 0 are bestpaths
  Cumulative no. of prefixes denied: 0.
  Prefix advertised 0, suppressed 0, withdrawn 0
  Maximum prefixes allowed 1048576
  Threshold for warning message 75%, restart interval 0 min
  An EoR was not received during read-only mode
  Last ack version 2, Last synced ack version 0
  Outstanding version objects: current 0, max 0
  Additional-paths operation: None

  Connections established 3; dropped 2
  Local host: 192.168.23.2, Local port: 31283, IF Handle: 0x00000000
  Foreign host: 192.168.23.3, Foreign port: 179
  Last reset 00:33:52, due to Peer closing down the session
  Peer reset reason: Remote closed the session (Connection timed out)
  Time since last notification sent to neighbor: 00:33:53
  Error Code: administrative reset
  Notification data sent:
    None
  Time since last notification received from neighbor: 00:40:28
  Error Code: peer in wrong AS
  Notification data received:
    EAFD0000
RP/0/0/CPU0:XR3#show bgp ipv4 unicast neighbors
Sat Mar 14 05:20:46.473 UTC

BGP neighbor is 192.168.23.2
 Remote AS 65002, local AS 65002, internal link
 Remote router ID 2.2.2.2
  BGP state = Established, up for 00:33:44
  NSR State: None
  Last read 00:00:18, Last read before reset 00:34:05
  Hold time is 120, keepalive interval is 40 seconds
  Configured hold time: 120, keepalive: 40, min acceptable hold time: 3
  Last write 00:00:18, attempted 19, written 19
  Second last write 00:00:58, attempted 19, written 19
  Last write before reset 00:34:25, attempted 19, written 19
  Second last write before reset 00:35:25, attempted 19, written 19
  Last write pulse rcvd  Mar 14 05:20:27.944 last full not set pulse count 139
  Last write pulse rcvd before reset 00:34:25
  Socket not armed for io, armed for read, armed for write
  Last write thread event before reset 00:34:25, second last 00:34:25
  Last KA expiry before reset 00:34:25, second last 00:35:25
  Last KA error before reset 00:00:00, KA not sent 00:00:00
  Last KA start before reset 00:34:25, second last 00:35:25
  Precedence: internet
  Non-stop routing is enabled
  Multi-protocol capability received
  Neighbor capabilities:
    Route refresh: advertised (old + new) and received (old + new)
    4-byte AS: advertised and received
    Address family IPv4 Unicast: advertised and received
  Received 72 messages, 7 notifications, 0 in queue
  Sent 71 messages, 1 notifications, 0 in queue
  Minimum time between advertisement runs is 0 secs
  Inbound message logging enabled, 3 messages buffered
  Outbound message logging enabled, 3 messages buffered

 For Address Family: IPv4 Unicast
  BGP neighbor version 2
  Update group: 0.1 Filter-group: 0.1  No Refresh request being processed
  Route refresh request: received 0, sent 0
  0 accepted prefixes, 0 are bestpaths
  Cumulative no. of prefixes denied: 0.
  Prefix advertised 0, suppressed 0, withdrawn 0
  Maximum prefixes allowed 1048576
  Threshold for warning message 75%, restart interval 0 min
  An EoR was received during read-only mode
  Last ack version 2, Last synced ack version 0
  Outstanding version objects: current 0, max 0
  Additional-paths operation: None

  Connections established 3; dropped 2
  Local host: 192.168.23.3, Local port: 179, IF Handle: 0x00000000
  Foreign host: 192.168.23.2, Foreign port: 31283
  Last reset 00:34:05, due to BGP Notification received: administrative reset
  Time since last notification sent to neighbor: 00:40:40
  Error Code: peer in wrong AS
  Notification data sent:
    EAFD0000
  Time since last notification received from neighbor: 00:34:05
  Error Code: administrative reset
  Notification data received:
    None