0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

BGPの設定について調べているとよく登場する「リセット」について,パケットキャプチャで各コマンドの挙動を調べてみました。

読者に求める前提条件

  • BGPにおけるリセットが何のための操作なのか理解している
  • BGPソフトリセットが,ハードリセットに比べてどのような特徴を持っているか理解している
  • TCPとUDPの違いが分かっている

この記事のゴール

Cisco IOS XEにおける以下6コマンドの違いが説明できるようになります。

  • clear ip bgp [ネイバーのIPアドレス]
  • clear ip bgp [ネイバーのIPアドレス] out
  • clear ip bgp [ネイバーのIPアドレス] in
  • clear ip bgp [ネイバーのIPアドレス] soft
  • clear ip bgp [ネイバーのIPアドレス] soft out
  • clear ip bgp [ネイバーのIPアドレス] soft in

検証環境

構成図

Cisco Modeling Labsで動かしたい人はこのYAMLファイルをインポートしてください
annotations:
  - border_color: '#00000000'
    border_style: ''
    color: '#FDF300'
    rotation: 0
    text_bold: false
    text_content: 172.16.0.0/16
    text_font: monospace
    text_italic: false
    text_size: 12
    text_unit: pt
    thickness: 1
    type: text
    x1: -40.0
    y1: -80.0
    z_index: 0
  - border_color: '#00000000'
    border_style: ''
    color: '#FDF300'
    rotation: 0
    text_bold: false
    text_content: 172.31.0.0/16
    text_font: monospace
    text_italic: false
    text_size: 12
    text_unit: pt
    thickness: 1
    type: text
    x1: -440.0
    y1: -80.0
    z_index: 0
  - border_color: '#00000000'
    border_style: ''
    color: '#FDF300'
    rotation: 0
    text_bold: false
    text_content: 172.30.0.0/16
    text_font: monospace
    text_italic: false
    text_size: 12
    text_unit: pt
    thickness: 1
    type: text
    x1: 360.0
    y1: -80.0
    z_index: 0
  - border_color: '#00000000'
    border_style: ''
    color: '#FDF300'
    rotation: 0
    text_bold: false
    text_content: .0.2
    text_font: monospace
    text_italic: false
    text_size: 12
    text_unit: pt
    thickness: 1
    type: text
    x1: 240.0
    y1: -40.0
    z_index: 0
  - border_color: '#00000000'
    border_style: ''
    color: '#FDF300'
    rotation: 0
    text_bold: false
    text_content: .0.1
    text_font: monospace
    text_italic: false
    text_size: 12
    text_unit: pt
    thickness: 1
    type: text
    x1: 320.0
    y1: -40.0
    z_index: 0
  - border_color: '#00000000'
    border_style: ''
    color: '#FDF300'
    rotation: 0
    text_bold: false
    text_content: .0.1
    text_font: monospace
    text_italic: false
    text_size: 12
    text_unit: pt
    thickness: 1
    type: text
    x1: -200.0
    y1: -40.0
    z_index: 0
  - border_color: '#00000000'
    border_style: ''
    color: '#FDF300'
    rotation: 0
    text_bold: false
    text_content: .0.1
    text_font: monospace
    text_italic: false
    text_size: 12
    text_unit: pt
    thickness: 1
    type: text
    x1: -280.0
    y1: -40.0
    z_index: 0
  - border_color: '#00FF52'
    border_style: 2,2
    color: '#FFFFFFFF'
    line_end: null
    line_start: null
    thickness: 4
    type: line
    x1: 40.0
    y1: -200.0
    x2: 40.0
    y2: 200.0
    z_index: 1
  - border_color: '#00000000'
    border_style: ''
    color: '#00FF52'
    rotation: 0
    text_bold: false
    text_content: AS65535.1
    text_font: monospace
    text_italic: false
    text_size: 12
    text_unit: pt
    thickness: 1
    type: text
    x1: -120.0
    y1: -160.0
    z_index: 2
  - border_color: '#00000000'
    border_style: ''
    color: '#00FF52'
    rotation: 0
    text_bold: false
    text_content: AS65535.2
    text_font: monospace
    text_italic: false
    text_size: 12
    text_unit: pt
    thickness: 1
    type: text
    x1: 120.0
    y1: -160.0
    z_index: 2
nodes:
  - boot_disk_size: null
    configuration:
      - name: ios_config.txt
        content: |-
          Building configuration...

          Current configuration : 2731 bytes
          !
          ! Last configuration change at 23:26:49 JST Sun Jan 12 2025
          !
          version 17.12
          service timestamps debug datetime localtime
          service timestamps log datetime localtime
          !
          hostname router-1
          !
          boot-start-marker
          boot-end-marker
          !
          !
          no logging console
          no aaa new-model
          !
          !
          !
          clock timezone JST 9 0
          !
          !
          !
          !
          !
          !
          !
          ip dhcp excluded-address 172.31.0.1
          !
          ip dhcp pool DHCP-pool
           network 172.31.0.0 255.255.0.0
           default-router 172.31.0.1
          !
          !
          !
          ip cef
          login on-success log
          no ipv6 cef
          !
          !
          !
          !
          !
          !
          !
          !
          multilink bundle-name authenticated
          !
          !
          !
          !
          !
          memory free low-watermark processor 81225
          !
          !
          spanning-tree mode rapid-pvst
          !
          !
          !
          !
          !
          !
          no cdp run
          !
          lldp run
          !
          !
          !
          !
          !
          !
          !
          !
          !
          !
          !
          !
          !
          !
          !
          !
          interface Ethernet0/0
           description router-2
           ip address 172.16.0.1 255.255.0.0
          !
          interface Ethernet0/1
           no ip address
           shutdown
          !
          interface Ethernet0/2
           no ip address
           shutdown
          !
          interface Ethernet0/3
           no ip address
           shutdown
          !
          interface Ethernet1/0
           no ip address
           shutdown
          !
          interface Ethernet1/1
           no ip address
           shutdown
          !
          interface Ethernet1/2
           no ip address
           shutdown
          !
          interface Ethernet1/3
           no ip address
           shutdown
          !
          interface Ethernet2/0
           no ip address
           shutdown
          !
          interface Ethernet2/1
           no ip address
           shutdown
          !
          interface Ethernet2/2
           no ip address
           shutdown
          !
          interface Ethernet2/3
           no ip address
           shutdown
          !
          interface Ethernet3/0
           no ip address
           shutdown
          !
          interface Ethernet3/1
           no ip address
           shutdown
          !
          interface Ethernet3/2
           no ip address
           shutdown
          !
          interface Ethernet3/3
           no ip address
           shutdown
          !
          interface Ethernet4/0
           no ip address
           shutdown
          !
          interface Ethernet4/1
           no ip address
           shutdown
          !
          interface Ethernet4/2
           no ip address
           shutdown
          !
          interface Ethernet4/3
           no ip address
           shutdown
          !
          interface Ethernet5/0
           no ip address
           shutdown
          !
          interface Ethernet5/1
           no ip address
           shutdown
          !
          interface Ethernet5/2
           no ip address
           shutdown
          !
          interface Ethernet5/3
           no ip address
           shutdown
          !
          interface Ethernet6/0
           no ip address
           shutdown
          !
          interface Ethernet6/1
           no ip address
           shutdown
          !
          interface Ethernet6/2
           no ip address
           shutdown
          !
          interface Ethernet6/3
           no ip address
           shutdown
          !
          interface Ethernet7/0
           description Desktop-1
           ip address 172.31.0.1 255.255.0.0
          !
          interface Ethernet7/1
           no ip address
           shutdown
          !
          interface Ethernet7/2
           no ip address
           shutdown
          !
          interface Ethernet7/3
           no ip address
           shutdown
          !
          router bgp 65535.1
           bgp asnotation dot
           bgp log-neighbor-changes
           network 172.31.0.0
           neighbor 172.16.0.2 remote-as 65535.2
          !
          ip forward-protocol nd
          !
          !
          ip http server
          ip http secure-server
          ip ssh bulk-mode 131072
          !
          !
          !
          !
          !
          control-plane
          !
          !
          !
          line con 0
           exec-timeout 0 0
           privilege level 15
           logging synchronous
           transport preferred none
          line aux 0
          line vty 0 4
           exec-timeout 0 0
           login
           transport input ssh
          !
          !
          !
          !
          end
    cpu_limit: null
    cpus: null
    data_volume: null
    hide_links: false
    id: n0
    image_definition: null
    label: router-1
    node_definition: iol-xe
    parameters: {}
    ram: null
    tags: []
    x: -240
    y: 0
    interfaces:
      - id: i0
        label: Loopback0
        type: loopback
      - id: i1
        label: Ethernet0/0
        slot: 0
        type: physical
      - id: i2
        label: Ethernet0/1
        slot: 1
        type: physical
      - id: i3
        label: Ethernet0/2
        slot: 2
        type: physical
      - id: i4
        label: Ethernet0/3
        slot: 3
        type: physical
      - id: i5
        label: Ethernet1/0
        slot: 4
        type: physical
      - id: i6
        label: Ethernet1/1
        slot: 5
        type: physical
      - id: i7
        label: Ethernet1/2
        slot: 6
        type: physical
      - id: i8
        label: Ethernet1/3
        slot: 7
        type: physical
      - id: i9
        label: Ethernet2/0
        slot: 8
        type: physical
      - id: i10
        label: Ethernet2/1
        slot: 9
        type: physical
      - id: i11
        label: Ethernet2/2
        slot: 10
        type: physical
      - id: i12
        label: Ethernet2/3
        slot: 11
        type: physical
      - id: i13
        label: Ethernet3/0
        slot: 12
        type: physical
      - id: i14
        label: Ethernet3/1
        slot: 13
        type: physical
      - id: i15
        label: Ethernet3/2
        slot: 14
        type: physical
      - id: i16
        label: Ethernet3/3
        slot: 15
        type: physical
      - id: i17
        label: Ethernet4/0
        slot: 16
        type: physical
      - id: i18
        label: Ethernet4/1
        slot: 17
        type: physical
      - id: i19
        label: Ethernet4/2
        slot: 18
        type: physical
      - id: i20
        label: Ethernet4/3
        slot: 19
        type: physical
      - id: i21
        label: Ethernet5/0
        slot: 20
        type: physical
      - id: i22
        label: Ethernet5/1
        slot: 21
        type: physical
      - id: i23
        label: Ethernet5/2
        slot: 22
        type: physical
      - id: i24
        label: Ethernet5/3
        slot: 23
        type: physical
      - id: i25
        label: Ethernet6/0
        slot: 24
        type: physical
      - id: i26
        label: Ethernet6/1
        slot: 25
        type: physical
      - id: i27
        label: Ethernet6/2
        slot: 26
        type: physical
      - id: i28
        label: Ethernet6/3
        slot: 27
        type: physical
      - id: i29
        label: Ethernet7/0
        slot: 28
        type: physical
  - boot_disk_size: null
    configuration:
      - name: ios_config.txt
        content: |-
          Building configuration...

          Current configuration : 2731 bytes
          !
          ! Last configuration change at 23:26:49 JST Sun Jan 12 2025
          !
          version 17.12
          service timestamps debug datetime localtime
          service timestamps log datetime localtime
          !
          hostname router-2
          !
          boot-start-marker
          boot-end-marker
          !
          !
          no logging console
          no aaa new-model
          !
          !
          !
          clock timezone JST 9 0
          !
          !
          !
          !
          !
          !
          !
          ip dhcp excluded-address 172.30.0.1
          !
          ip dhcp pool DHCP-pool
           network 172.30.0.0 255.255.0.0
           default-router 172.30.0.1
          !
          !
          !
          ip cef
          login on-success log
          no ipv6 cef
          !
          !
          !
          !
          !
          !
          !
          !
          multilink bundle-name authenticated
          !
          !
          !
          !
          !
          memory free low-watermark processor 81225
          !
          !
          spanning-tree mode rapid-pvst
          !
          !
          !
          !
          !
          !
          no cdp run
          !
          lldp run
          !
          !
          !
          !
          !
          !
          !
          !
          !
          !
          !
          !
          !
          !
          !
          !
          interface Ethernet0/0
           description router-1
           ip address 172.16.0.2 255.255.0.0
          !
          interface Ethernet0/1
           no ip address
           shutdown
          !
          interface Ethernet0/2
           no ip address
           shutdown
          !
          interface Ethernet0/3
           no ip address
           shutdown
          !
          interface Ethernet1/0
           no ip address
           shutdown
          !
          interface Ethernet1/1
           no ip address
           shutdown
          !
          interface Ethernet1/2
           no ip address
           shutdown
          !
          interface Ethernet1/3
           no ip address
           shutdown
          !
          interface Ethernet2/0
           no ip address
           shutdown
          !
          interface Ethernet2/1
           no ip address
           shutdown
          !
          interface Ethernet2/2
           no ip address
           shutdown
          !
          interface Ethernet2/3
           no ip address
           shutdown
          !
          interface Ethernet3/0
           no ip address
           shutdown
          !
          interface Ethernet3/1
           no ip address
           shutdown
          !
          interface Ethernet3/2
           no ip address
           shutdown
          !
          interface Ethernet3/3
           no ip address
           shutdown
          !
          interface Ethernet4/0
           no ip address
           shutdown
          !
          interface Ethernet4/1
           no ip address
           shutdown
          !
          interface Ethernet4/2
           no ip address
           shutdown
          !
          interface Ethernet4/3
           no ip address
           shutdown
          !
          interface Ethernet5/0
           no ip address
           shutdown
          !
          interface Ethernet5/1
           no ip address
           shutdown
          !
          interface Ethernet5/2
           no ip address
           shutdown
          !
          interface Ethernet5/3
           no ip address
           shutdown
          !
          interface Ethernet6/0
           no ip address
           shutdown
          !
          interface Ethernet6/1
           no ip address
           shutdown
          !
          interface Ethernet6/2
           no ip address
           shutdown
          !
          interface Ethernet6/3
           no ip address
           shutdown
          !
          interface Ethernet7/0
           description Desktop-2
           ip address 172.30.0.1 255.255.0.0
          !
          interface Ethernet7/1
           no ip address
           shutdown
          !
          interface Ethernet7/2
           no ip address
           shutdown
          !
          interface Ethernet7/3
           no ip address
           shutdown
          !
          router bgp 65535.2
           bgp asnotation dot
           bgp log-neighbor-changes
           network 172.30.0.0
           neighbor 172.16.0.1 remote-as 65535.1
          !
          ip forward-protocol nd
          !
          !
          ip http server
          ip http secure-server
          ip ssh bulk-mode 131072
          !
          !
          !
          !
          !
          control-plane
          !
          !
          !
          line con 0
           exec-timeout 0 0
           privilege level 15
           logging synchronous
           transport preferred none
          line aux 0
          line vty 0 4
           exec-timeout 0 0
           login
           transport input ssh
          !
          !
          !
          !
          end
    cpu_limit: null
    cpus: null
    data_volume: null
    hide_links: false
    id: n1
    image_definition: null
    label: router-2
    node_definition: iol-xe
    parameters: {}
    ram: null
    tags: []
    x: 280
    y: 0
    interfaces:
      - id: i0
        label: Loopback0
        type: loopback
      - id: i1
        label: Ethernet0/0
        slot: 0
        type: physical
      - id: i2
        label: Ethernet0/1
        slot: 1
        type: physical
      - id: i3
        label: Ethernet0/2
        slot: 2
        type: physical
      - id: i4
        label: Ethernet0/3
        slot: 3
        type: physical
      - id: i5
        label: Ethernet1/0
        slot: 4
        type: physical
      - id: i6
        label: Ethernet1/1
        slot: 5
        type: physical
      - id: i7
        label: Ethernet1/2
        slot: 6
        type: physical
      - id: i8
        label: Ethernet1/3
        slot: 7
        type: physical
      - id: i9
        label: Ethernet2/0
        slot: 8
        type: physical
      - id: i10
        label: Ethernet2/1
        slot: 9
        type: physical
      - id: i11
        label: Ethernet2/2
        slot: 10
        type: physical
      - id: i12
        label: Ethernet2/3
        slot: 11
        type: physical
      - id: i13
        label: Ethernet3/0
        slot: 12
        type: physical
      - id: i14
        label: Ethernet3/1
        slot: 13
        type: physical
      - id: i15
        label: Ethernet3/2
        slot: 14
        type: physical
      - id: i16
        label: Ethernet3/3
        slot: 15
        type: physical
      - id: i17
        label: Ethernet4/0
        slot: 16
        type: physical
      - id: i18
        label: Ethernet4/1
        slot: 17
        type: physical
      - id: i19
        label: Ethernet4/2
        slot: 18
        type: physical
      - id: i20
        label: Ethernet4/3
        slot: 19
        type: physical
      - id: i21
        label: Ethernet5/0
        slot: 20
        type: physical
      - id: i22
        label: Ethernet5/1
        slot: 21
        type: physical
      - id: i23
        label: Ethernet5/2
        slot: 22
        type: physical
      - id: i24
        label: Ethernet5/3
        slot: 23
        type: physical
      - id: i25
        label: Ethernet6/0
        slot: 24
        type: physical
      - id: i26
        label: Ethernet6/1
        slot: 25
        type: physical
      - id: i27
        label: Ethernet6/2
        slot: 26
        type: physical
      - id: i28
        label: Ethernet6/3
        slot: 27
        type: physical
      - id: i29
        label: Ethernet7/0
        slot: 28
        type: physical
  - boot_disk_size: null
    configuration: []
    cpu_limit: null
    cpus: null
    data_volume: null
    hide_links: false
    id: n2
    image_definition: null
    label: Desktop-1
    node_definition: desktop
    parameters: {}
    ram: null
    tags: []
    x: -520
    y: 0
    interfaces:
      - id: i0
        label: eth0
        slot: 0
        type: physical
  - boot_disk_size: null
    configuration: []
    cpu_limit: null
    cpus: null
    data_volume: null
    hide_links: false
    id: n3
    image_definition: null
    label: Desktop-2
    node_definition: desktop
    parameters: {}
    ram: null
    tags: []
    x: 520
    y: 0
    interfaces:
      - id: i0
        label: eth0
        slot: 0
        type: physical
links:
  - id: l0
    n1: n0
    n2: n1
    i1: i1
    i2: i1
    conditioning: {}
    label: router-1-Ethernet0/0<->router-2-Ethernet0/0
  - id: l1
    n1: n0
    n2: n2
    i1: i29
    i2: i0
    conditioning: {}
    label: router-1-Ethernet7/0<->Desktop-1-eth0
  - id: l2
    n1: n1
    n2: n3
    i1: i29
    i2: i0
    conditioning: {}
    label: router-2-Ethernet7/0<->Desktop-2-eth0
lab:
  description: ''
  notes: ''
  title: BGPのソフトリセット
  version: 0.2.2

router-1・router-2のBGP設定は以下のようになっています。router-1からは172.31.0.0/16,router-2からは172.30.0.0/16が広告されています。

router-1
router bgp 65535.1
 bgp asnotation dot
 bgp log-neighbor-changes
 network 172.31.0.0
 neighbor 172.16.0.2 remote-as 65535.2
router-2
router bgp 65535.2
 bgp asnotation dot
 bgp log-neighbor-changes
 network 172.30.0.0
 neighbor 172.16.0.1 remote-as 65535.1

BGPテーブルを見ると,コンフィグの通りに互いの経路が伝わっていることが分かります。

router-1#show ip bgp
BGP table version is 3, local router ID is 172.31.0.1
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, 
              t secondary path, L long-lived-stale,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>   172.30.0.0       172.16.0.2               0             0 65535.2 i
 *>   172.31.0.0       0.0.0.0                  0         32768 i
router-2#show ip bgp
BGP table version is 3, local router ID is 172.30.0.1
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, 
              t secondary path, L long-lived-stale,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>   172.30.0.0       0.0.0.0                  0         32768 i
 *>   172.31.0.0       172.16.0.1               0             0 65535.1 i

今回の検証環境では「Enhanced Route Refresh」1という方法でソフトリセットが動作します。これは今回の検証で使用したルーターに搭載されているCisco IOS XE 17.12.1のデフォルト設定です。

BGPソフトリセットの方法が異なる場合この記事と同じコマンドを打っても違う挙動を示すことがありますが,大まかに言えばやりたいことは同じなので参考にはなるかと思います。

検証結果

BGPリセットを行う各コマンドをrouter-1で実行していきます。

ここからパケットキャプチャのスクリーンショットを貼っていきますが,

  • キャプチャ箇所:router-1・router-2間
  • フィルター:TCP・BGPのみ

という条件でキャプチャを実行しています。

clear ip bgp 172.16.0.2

ハードリセット NOTIFICATION〜OPEN

まず,コマンドを実行したrouter-1からBGPのNOTIFICATION Messageが飛んでいます(パケットNo.9)。これはBGPセッションを終了する合図になります。

その合図の後,パケットNo.10〜パケットNo.13でTCPのセッション終了シーケンスが観測できます。「Info」の列にBGPのポート番号179が見えるため,これはrouter-1・router-2がBGPでやり取りするために使っていたTCPセッションだとわかります。

TCPセッションが終了した直後,パケットNo.14〜パケットNo.16でrouter-1・router-2間のTCPセッション開始シーケンス(3ウェイハンドシェイク)が観測できます。また,TCPのセッションが確立された後のパケットNo.17・19ではBGPのOPEN Messageも流れています。これは,BGPセッションを確立する際最初にやり取りされるメッセージです。

続きを見てみましょう。

ハードリセット OPEN〜UPDATE

OPEN Messageの後,パケットNo.24・26で経路を広告するUPDATE Messageがrouter-1・router-2双方から送信されています。
中身を見てみると,

ハードリセット UPDATE Message(router-1→router-2)

ハードリセット UPDATE Message(router-2→router-1)

router-1からは172.31.0.0/16が,router-2からは172.30.0.0/16が広告されています。これは,セッション確立時に互いが手持ちの経路を全て広告し合う動作ですね。

まとめると,clear ip bgp 172.16.0.2ではBGPセッションの終了→開始が一瞬のうちに行われました。BGPセッションから仕切り直すということは,これは ハードリセット です。

clear ip bgp 172.16.0.2 out

ソフトリセット(out)のシーケンス

先ほどと打って変わってシーケンスは短いです。

KEEPALIVE Messageはネイバーの生存確認なので無視するとして,残りのBGP MessageはUPDATEと「ROUTE-REFRESH」です。

まずはパケットNo.6のROUTE-REFRESH Messageの詳細を見てみましょう。

ソフトリセット(out) ROUTE-REFRESH開始パケットの詳細

「Subtype」のフィールドの値の説明が「Demarcation of the beginning of a route refresh」になっています。これを日本語に訳すと「route refreshの開始の境界」となります。
訳してもやや分かりにくいですが,このSubtypeを持つROUTE-REFRESH Messageは「今から手持ちの全経路を広告しますよ〜」という合図になります1

次にパケットNo.7の詳細を見てみましょう。このパケットにはUPDATE MessageとROUTE-REFRESH Messageがまとまって入っています。

ソフトリセット(out) UPDATEパケット・ROUTE-REFRESH終了パケットの詳細

UPDATE Messageではrouter-1が持っている172.31.0.0/16が伝わっています。router-1の手持ちはこれしか無いのでUPDATE Messageは終わりです。

UPDATE Messageの後にはROUTE-REFRESH Messageがくっついていますが,Subtypeが先ほどと違います。今回のSubtypeは「Demarcation of the ending of a route refresh」,日本語で「route refreshの終了の境界」となります。
このSubtypeを持つROUTE-REFRESH Messageは「これで手持ちの経路は全部ですよ〜」という合図になります1

まとめると,clear ip bgp 172.16.0.2 outではコマンド実行側のrouter-1からネイバーのrouter-2に向けて手持ちの経路が全て送られました。この処理はBGPセッションを断つこと無く行われたため, ソフトリセット にあたります。

clear ip bgp 172.16.0.2 in

ソフトリセット(in)のシーケンス

outでリセットしたときと同じROUTE-REFRESH(パケットNo.10)→UPDATE(パケットNo.11)→ROUTE-REFRESH(パケットNo.11)のシーケンスが見えますが,送信方向が逆になっています。また,そのシーケンスの前にもROUTE-REFRESH Messageが追加で1つ(パケットNo.9)見えます。

まずはパケットNo.9のROUTE-REFRESH Messageを詳しく調べましょう。

ソフトリセット(in) ROUTE-REFRESHリクエストの詳細

このパケットはコマンド実行側であるrouter-1からrouter-2に向けて送信されています。

Subtypeを見ると「Normal route refresh request」となっています。このSubtypeを持つROUTE-REFRESH Messageは,「あなたが持っている経路を全て広告しなおしてください」というrequestです12。だから,outでリセットしたときと同じシーケンスが逆向きで見えたのです。

もうネタバレは言ってしまいましたが,後続のROUTE-REFRESH→UPDATE→ROUTE-REFRESHも一応詳細を貼っておきます。

ソフトリセット(in) ROUTE-REFRESH開始パケットの詳細

ソフトリセット(in) UPDATEパケット・ROUTE-REFRESH終了パケットの詳細

UPDATE Messageには,router-2が持つ172.30.0.0/16がきちんと載っていますね。

まとめると,clear ip bgp 172.16.0.2 inではネイバーのrouter-2からコマンド実行側のrouter-1に向けて手持ちの経路が全て送られました。この処理も,BGPセッションを断つこと無く行われたため ソフトリセット にあたります。

残りの3コマンドについて

ここまでで取り上げていないコマンドが3つありますね。

  • clear ip bgp [ネイバーのIPアドレス] soft
  • clear ip bgp [ネイバーのIPアドレス] soft out
  • clear ip bgp [ネイバーのIPアドレス] soft in

しかし,これらのコマンドの挙動はヘルプを見れば明白です。

router-1#clear ip bgp 172.16.0.2 ?
  all              All address families
  cease            send cease notification to neighbor
  flap-statistics  Clear flap statistic
  in               Soft reconfig inbound updates
  ipv4             Address family
  ipv6             Address family
  l2vpn            Address family
  link-state       Address family
  nsap             Address family
  out              Soft reconfig outbound updates
  rtfilter         Address family
  slow             Forcefully clear slow-peer status and move it to original
                   update group
  soft             Soft reconfig inbound and outbound updates
  topology         Routing topology instance
  vpnv4            Address family
  vpnv6            Address family
  <cr>             <cr>

router-1#clear ip bgp 172.16.0.2 soft ?
  in    Soft reconfig inbound updates
  out   Soft reconfig outbound updates
  slow  Forcefully clear slow-peer status and move it to original update group
  <cr>  <cr>

まずclear ip bgp [ネイバーのIPアドレス] soft outの説明を見てみると,

Soft reconfig outbound updates

となっています。しかし,これはsoft無しの方と全く一緒です。

この関係はinについても同様ですね。

clear ip bgp [ネイバーのIPアドレス] softも,説明が

Soft reconfig inbound and outbound updates

とあり,inのソフトリセットとoutのソフトリセットを1コマンドで実行できるものなのは明らかです。

まとめ

コマンド 用途
clear ip bgp [ネイバーのIPアドレス] ハードリセット
clear ip bgp [ネイバーのIPアドレス] out ソフトリセット(コマンド実行側→ネイバー)
clear ip bgp [ネイバーのIPアドレス] in ソフトリセット(ネイバー→コマンド実行側)
clear ip bgp [ネイバーのIPアドレス] soft outin
clear ip bgp [ネイバーのIPアドレス] soft out 文字数の無駄
clear ip bgp [ネイバーのIPアドレス] soft in 文字数の無駄
  1. 【参考文献】RFC 7313:2014.Enhanced Route Refresh Capability for BGP-4.Internet Engineering Task Force. 2 3 4

  2. 【参考文献】RFC 2918:2000.Route Refresh Capability for BGP-4.Internet Engineering Task Force.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?