atwiki-logo
  • 新規作成
    • 新規ページ作成
    • 新規ページ作成(その他)
      • このページをコピーして新規ページ作成
      • このウィキ内の別ページをコピーして新規ページ作成
      • このページの子ページを作成
    • 新規ウィキ作成
  • 編集
    • ページ編集
    • ページ編集(簡易版)
    • ページ名変更
    • メニュー非表示でページ編集
    • ページの閲覧/編集権限変更
    • ページの編集モード変更
    • このページにファイルをアップロード
    • メニューを編集
    • 右メニューを編集
  • バージョン管理
    • 最新版変更点(差分)
    • 編集履歴(バックアップ)
    • アップロードファイル履歴
    • ページ操作履歴
  • ページ一覧
    • ページ一覧
    • このウィキのタグ一覧
    • このウィキのタグ(更新順)
    • おまかせページ移動
  • RSS
    • このウィキの更新情報RSS
    • このウィキ新着ページRSS
  • ヘルプ
    • ご利用ガイド
    • Wiki初心者向けガイド(基本操作)
    • このウィキの管理者に連絡
    • 運営会社に連絡(不具合、障害など)
ページ検索 メニュー
DynagenでCCIEを目指す
  • ウィキ募集バナー
  • 目安箱バナー
  • 操作ガイド
  • 新規作成
  • 編集する
  • 全ページ一覧
  • 登録/ログイン
ページ一覧
DynagenでCCIEを目指す
  • ウィキ募集バナー
  • 目安箱バナー
  • 操作ガイド
  • 新規作成
  • 編集する
  • 全ページ一覧
  • 登録/ログイン
ページ一覧
DynagenでCCIEを目指す
ページ検索 メニュー
  • 新規作成
  • 編集する
  • 登録/ログイン
  • 管理メニュー
管理メニュー
  • 新規作成
    • 新規ページ作成
    • 新規ページ作成(その他)
      • このページをコピーして新規ページ作成
      • このウィキ内の別ページをコピーして新規ページ作成
      • このページの子ページを作成
    • 新規ウィキ作成
  • 編集
    • ページ編集
    • ページ編集(簡易版)
    • ページ名変更
    • メニュー非表示でページ編集
    • ページの閲覧/編集権限変更
    • ページの編集モード変更
    • このページにファイルをアップロード
    • メニューを編集
    • 右メニューを編集
  • バージョン管理
    • 最新版変更点(差分)
    • 編集履歴(バックアップ)
    • アップロードファイル履歴
    • ページ操作履歴
  • ページ一覧
    • このウィキの全ページ一覧
    • このウィキのタグ一覧
    • このウィキのタグ一覧(更新順)
    • このページの全コメント一覧
    • このウィキの全コメント一覧
    • おまかせページ移動
  • RSS
    • このwikiの更新情報RSS
    • このwikiの新着ページRSS
  • ヘルプ
    • ご利用ガイド
    • Wiki初心者向けガイド(基本操作)
    • このウィキの管理者に連絡
    • 運営会社に連絡する(不具合、障害など)
  • atwiki
  • DynagenでCCIEを目指す
  • トップページ
  • 動作検証 ネットワーク系
  • 20100530 BGP 基本設定

DynagenでCCIEを目指す

20100530 BGP 基本設定

最終更新:2010年06月06日 13:07

it_certification

- view
管理者のみ編集可
  • 目的
  • 構成
  • 検証1 BGPによるneighbor確立
  • 検証2 再配送による通知
  • 検証3 Originの変更
  • 補足 パケットの確認

目的

  • BGPの基本的な設定を確認します。

構成

  • 設定概要
    • BGPによってルーティングします。
  • 構成図
  • netファイル
model = 3620
[localhost]
	
	[[3620]]
		image = C:\Program Files\Dynamips\images\c3620-j1s3-mz.123-18.bin
		ram = 128
	
	[[ROUTER R1]]
		f0/0 = R2 f0/0
		
	[[ROUTER R2]]
  • 初期設定 R1
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
!
ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.1.0.1 255.255.255.0 secondary
 ip address 10.1.1.1 255.255.255.0 secondary
 ip address 10.1.2.1 255.255.255.0 secondary
 ip address 10.1.3.1 255.255.255.0 secondary
 ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
 ip address 192.168.1.1 255.255.255.0
 duplex auto
 speed auto
!
ip http server
ip classless
!
!
!
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
!
!
end
  • 初期設定 R2
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
!
ip cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.2.0.1 255.255.255.0 secondary
 ip address 10.2.1.1 255.255.255.0 secondary
 ip address 10.2.2.1 255.255.255.0 secondary
 ip address 10.2.3.1 255.255.255.0 secondary
 ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
 ip address 192.168.1.2 255.255.255.0
 duplex auto
 speed auto
!
ip http server
ip classless
!
!
!
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
!
!
end

検証1 BGPによるneighbor確立

  • 設定の投入
R1, R2の間で、BGP neighborを確立させます。また、互いのloopback addressをnetworkコマンドによって通知します。
R1(config)#router bgp 1
R1(config-router)#neighbor 192.168.1.2 remote-as 2
R1(config-router)#network 1.1.1.1 mask 255.255.255.255

R2(config)#router bgp 2
R2(config-router)#neighbor 192.168.1.1 remote-as 1
R2(config-router)#network 2.2.2.2 mask 255.255.255.255

  • 設定確認
設定確認を行います。show ip protocolでは、AS番号やneighborの一覧を確認できます。
R1#show ip protocols
Routing Protocol is "bgp 1"                                         <- R1のAS番号
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  IGP synchronization is disabled
  Automatic route summarization is disabled
  Neighbor(s):                                                      <- neighborの一覧
    Address          FiltIn FiltOut DistIn DistOut Weight RouteMap
    192.168.1.2
  Maximum path: 1
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.1.2           20      00:03:08
  Distance: external 20 internal 200 local 200

R1#
show ip bgpコマンドでは、BGPテーブルが確認できます。
R1#show ip bgp
BGP table version is 3, local router ID is 1.1.1.1                             <- ルータID
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
*> 1.1.1.1/32       0.0.0.0                  0         32768 i     <- ">"の記載があるのが最短ルート
*> 2.2.2.2/32       192.168.1.2              0             0 2 i   <- ">"の記載があるのが最短ルート
R1#
show ip bgp summaryはBGPテーブルの概要が確認できます。また、「State/PfxRcd」に着目するとneighborが確立できたかどうかを確認できます。neighborが確立された状態ではBGPルートの数が表示され、未確立の状態ではIdle, Active等の状態が表示されます。
R1#show ip bgp summary
BGP router identifier 1.1.1.1, local AS number 1
BGP table version is 3, main routing table version 3
2 network entries using 202 bytes of memory
2 path entries using 96 bytes of memory
2 BGP path attribute entries using 120 bytes of memory
1 BGP AS-PATH entries using 24 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 442 total bytes of memory
BGP activity 2/0 prefixes, 2/0 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
192.168.1.2     4     2      17      17        3    0    0 00:12:02        1
R1#
ルーティングテーブルには「B」の表記でルートが記載されます。
R1#show ip route bgp
     2.0.0.0/32 is subnetted, 1 subnets
B       2.2.2.2 [20/0] via 192.168.1.2, 00:12:50
R1#

検証2 再配送による通知

  • 再配送の設定
R1のsecondary addressをR2に通知します。通知方法はconnectedを再配送します。
R1(config)#router bgp 1
R1(config-router)#redistribute connected
  • BGPデータベースの確認
再配送されたルートがR2に通知された事を確認します。また、再配送によって通知されたルートのOriginが「? - imcomplete」になっている事も読み取れます。
R2#show ip route bgp
     1.0.0.0/32 is subnetted, 1 subnets
B       1.1.1.1 [20/0] via 192.168.1.1, 00:08:11
     10.0.0.0/24 is subnetted, 8 subnets
B       10.1.3.0 [20/0] via 192.168.1.1, 00:01:46
B       10.1.2.0 [20/0] via 192.168.1.1, 00:01:46
B       10.1.1.0 [20/0] via 192.168.1.1, 00:01:46
B       10.1.0.0 [20/0] via 192.168.1.1, 00:01:46
R2#
R2#
R2#
R2#show ip bgp
BGP table version is 11, 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
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       192.168.1.1              0             0 1 i
*> 2.2.2.2/32       0.0.0.0                  0         32768 i
*> 10.1.0.0/24      192.168.1.1              0             0 1 ?
*> 10.1.1.0/24      192.168.1.1              0             0 1 ?
*> 10.1.2.0/24      192.168.1.1              0             0 1 ?
*> 10.1.3.0/24      192.168.1.1              0             0 1 ?
r> 192.168.1.0      192.168.1.1              0             0 1 ?
R2#

検証3 Originの変更

  • Originの変更
「究めるBGP」によると、検証2のように「? - imcomplete」として他ISPにルートを通知するのは望ましい状態ではありません(実践経験がないのであまりよく分かりませんが…)。そこで、route-mapを使用して、Originを「i(IGP)」に変更します。
R1(config)#route-map SET_ORIGIN_IGP permit 10
R1(config-route-map)#set origin igp
R1(config-route-map)#exit
R1(config)#
R1(config)#
R1(config)#router bgp 1
R1(config-router)#redistribute connected route-map SET_ORIGIN_IGP
  • Originの確認
originが「i(IGP)」に変わった事が確認できます。
R2#show ip bgp
BGP table version is 16, 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
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       192.168.1.1              0             0 1 i
*> 2.2.2.2/32       0.0.0.0                  0         32768 i
*> 10.1.0.0/24      192.168.1.1              0             0 1 i
*> 10.1.1.0/24      192.168.1.1              0             0 1 i
*> 10.1.2.0/24      192.168.1.1              0             0 1 i
*> 10.1.3.0/24      192.168.1.1              0             0 1 i
r> 192.168.1.0      192.168.1.1              0             0 1 i

補足 パケットの確認

  • debug ip bgp
debug ip bgpでbgp neighbor確立の様子を確認する事ができます。
R2#debug ip bgp
BGP debugging is on
R2#
*Mar  1 00:54:02.295: BGP: Applying map to find origin for 2.2.2.2/32
*Mar  1 00:55:02.331: BGP: Applying map to find origin for 2.2.2.2/32
*Mar  1 00:55:26.707: BGP: 192.168.1.1 connection timed out 180236ms (last update) 180000ms (hold time)
*Mar  1 00:55:26.707: BGP: 192.168.1.1 went from Established to Closing
*Mar  1 00:55:26.711: %BGP-5-ADJCHANGE: neighbor 192.168.1.1 Down BGP Notification sent
*Mar  1 00:55:26.711: %BGP-3-NOTIFICATION: sent to neighbor 192.168.1.1 4/0 (hold time expired) 0 bytes
*Mar  1 00:55:26.711: BGP: 192.168.1.1 send message type 3, length (incl. header) 21
*Mar  1 00:55:27.711: BGP: 192.168.1.1 local error close after sending NOTIFICATION
*Mar  1 00:55:28.711: BGPNSF state: 192.168.1.1 went from nsf_not_active to nsf_not_active
*Mar  1 00:55:28.715: BGP: 192.168.1.1 went from Closing to Idle
*Mar  1 00:55:28.715: BGP: 192.168.1.1 closing
*Mar  1 00:55:48.719: BGP: 192.168.1.1 went from Idle to Active
*Mar  1 00:55:48.719: BGP: 192.168.1.1 open active, delay 23541ms
*Mar  1 00:56:02.359: BGP: Applying map to find origin for 2.2.2.2/32
*Mar  1 00:56:10.539: BGP: 192.168.1.1 passive open
*Mar  1 00:56:10.539: BGP: 192.168.1.1 went from Active to Idle
*Mar  1 00:56:10.539: BGP: 192.168.1.1 went from Idle to Connect
*Mar  1 00:56:10.587: BGP: 192.168.1.1 rcv message type 1, length (excl. header) 26
*Mar  1 00:56:10.591: BGP: 192.168.1.1 rcv OPEN, version 4
*Mar  1 00:56:10.591: BGP: 192.168.1.1 went from Connect to OpenSent
*Mar  1 00:56:10.595: BGP: 192.168.1.1 sending OPEN, version 4, my as: 2
*Mar  1 00:56:10.595: BGP: 192.168.1.1 rcv OPEN w/ OPTION parameter len: 16
*Mar  1 00:56:10.595: BGP: 192.168.1.1 rcvd OPEN w/ optional parameter type 2 (Capability) len 6
*Mar  1 00:56:10.599: BGP: 192.168.1.1 OPEN has CAPABILITY code: 1, length 4
*Mar  1 00:56:10.599: BGP: 192.168.1.1 OPEN has MP_EXT CAP for afi/safi: 1/1
*Mar  1 00:56:10.603: BGP: 192.168.1.1 rcvd OPEN w/ optional parameter type 2 (Capability) len 2
*Mar  1 00:56:10.603: BGP: 192.168.1.1 OPEN has CAPABILITY code: 128, length 0
*Mar  1 00:56:10.607: BGP: 192.168.1.1 OPEN has ROUTE-REFRESH capability(old) for all address-families
*Mar  1 00:56:10.607: BGP: 192.168.1.1 rcvd OPEN w/ optional parameter type 2 (Capability) len 2
*Mar  1 00:56:10.611: BGP: 192.168.1.1 OPEN has CAPABILITY code: 2, length 0
*Mar  1 00:56:10.611: BGP: 192.168.1.1 OPEN has ROUTE-REFRESH capability(new) for all address-families
*Mar  1 00:56:10.615: BGP: 192.168.1.1 went from OpenSent to OpenConfirm
*Mar  1 00:56:10.615: BGP: 192.168.1.1 send message type 1, length (incl. header) 45
*Mar  1 00:56:10.643: BGP: 192.168.1.1 went from OpenConfirm to Established
*Mar  1 00:56:10.647: %BGP-5-ADJCHANGE: neighbor 192.168.1.1 Up
*Mar  1 00:57:02.411: BGP: Applying map to find origin for 2.2.2.2/32
*Mar  1 00:58:02.463: BGP: Applying map to find origin for 2.2.2.2/32

  • debug ip bgp updates
debug ip bgp updatesで通知されたルートを確認する事ができます。
R2#debug ip bgp updates
BGP updates debugging is on
R2#
*Mar  1 00:33:59.703: BGP(0): 192.168.1.1 rcvd UPDATE w/ attr: nexthop 192.168.1.1, origin ?, metric 0, path 1
*Mar  1 00:33:59.703: BGP(0): 192.168.1.1 rcvd 10.1.0.0/24
*Mar  1 00:33:59.707: BGP(0): 192.168.1.1 rcvd 10.1.1.0/24
*Mar  1 00:33:59.711: BGP(0): 192.168.1.1 rcvd 10.1.2.0/24
*Mar  1 00:33:59.715: BGP(0): 192.168.1.1 rcvd 10.1.3.0/24
*Mar  1 00:33:59.715: BGP(0): 192.168.1.1 rcvd 192.168.1.0/24
*Mar  1 00:33:59.715: BGP(0): Revise route installing 1 of 1 route for 10.1.0.0/24 -> 192.168.1.1 to main IP table
*Mar  1 00:33:59.719: BGP(0): Revise route installing 1 of 1 route for 10.1.1.0/24 -> 192.168.1.1 to main IP table
*Mar  1 00:33:59.723: BGP(0): Revise route installing 1 of 1 route for 10.1.2.0/24 -> 192.168.1.1 to main IP table
*Mar  1 00:33:59.731: BGP(0): Revise route installing 1 of 1 route for 10.1.3.0/24 -> 192.168.1.1 to main IP table
*Mar  1 00:33:59.735: BGP(0): Revise route installing 1 of 1 route for 192.168.1.0/24 -> 192.168.1.1 to main IP table
*Mar  1 00:33:59.739: BGP(0): 192.168.1.1 computing updates, afi 0, neighbor version 5, table version 11, starting at 0.0.0.0
*Mar  1 00:33:59.739: BGP(0): 192.168.1.1 update run completed, afi 0, ran for 0ms, neighbor version 5, start version 11, throttled to 11
*Mar  1 00:33:59.839: BGP(0): Revise route installing 1 of 1 route for 192.168.1.0/24 -> 192.168.1.1 to main IP table

  • パケットキャプチャによる確認
BGPの様子をパケットキャプチャします。TCP 179を使用して経路を交換したりneighborを確立したりしているのが分かります。IGPと違ってTCPを使用する仕様になっているのは、信頼性が求められるからです。
「20100530 BGP 基本設定」をウィキ内検索
LINE
シェア
Tweet
添付ファイル
  • tcp.jpg
  • topology.jpg
DynagenでCCIEを目指す
記事メニュー

メインコンテンツ

  • トップページ
  • トップページ/動作検証 ネットワーク系

更新履歴

取得中です。

@Wiki

  • @wiki
  • @wikiご利用ガイド
  • プラグイン紹介
  • まとめサイト作成支援ツール




ここを編集
記事メニュー2
人気記事ランキング
  1. トップページ/動作検証 ネットワーク系/http server management
  2. トップページ/動作検証 ネットワーク系/trunk接続 基本設定
  3. トップページ/動作検証 ネットワーク系/20100626 Anycast RP
  4. トップページ/手順書 ネットワーク系/Dynamips Dynagen 概要
  5. トップページ/動作検証 ネットワーク系/20100428 OSPFv3 基本設定
  6. トップページ/手順書 ネットワーク系/VLC media player (Windows版) 操作手順
  7. プラグイン
もっと見る
最近更新されたページ
  • 2990日前

    トップページ
  • 4189日前

    トップページ/手順書 ネットワーク系/Loopbackインターフェースとの接続
  • 4189日前

    トップページ/手順書 ネットワーク系
  • 4189日前

    トップページ/手順書 開発系
  • 4189日前

    トップページ/手順書 サーバ系
  • 4189日前

    トップページ/動作検証 ネットワーク系
  • 4902日前

    トップページ/動作検証 ネットワーク系/INE Workbook Volume II lab 15
  • 4923日前

    トップページ/動作検証 ネットワーク系/INE Workbook Volume II lab 14
  • 4936日前

    メニュー
  • 4946日前

    トップページ/動作検証 ネットワーク系/INE Workbook Volume II lab 13
もっと見る
人気記事ランキング
  1. トップページ/動作検証 ネットワーク系/http server management
  2. トップページ/動作検証 ネットワーク系/trunk接続 基本設定
  3. トップページ/動作検証 ネットワーク系/20100626 Anycast RP
  4. トップページ/手順書 ネットワーク系/Dynamips Dynagen 概要
  5. トップページ/動作検証 ネットワーク系/20100428 OSPFv3 基本設定
  6. トップページ/手順書 ネットワーク系/VLC media player (Windows版) 操作手順
  7. プラグイン
もっと見る
最近更新されたページ
  • 2990日前

    トップページ
  • 4189日前

    トップページ/手順書 ネットワーク系/Loopbackインターフェースとの接続
  • 4189日前

    トップページ/手順書 ネットワーク系
  • 4189日前

    トップページ/手順書 開発系
  • 4189日前

    トップページ/手順書 サーバ系
  • 4189日前

    トップページ/動作検証 ネットワーク系
  • 4902日前

    トップページ/動作検証 ネットワーク系/INE Workbook Volume II lab 15
  • 4923日前

    トップページ/動作検証 ネットワーク系/INE Workbook Volume II lab 14
  • 4936日前

    メニュー
  • 4946日前

    トップページ/動作検証 ネットワーク系/INE Workbook Volume II lab 13
もっと見る
ウィキ募集バナー
新規Wikiランキング

最近作成されたWikiのアクセスランキングです。見るだけでなく加筆してみよう!

  1. MadTown GTA (Beta) まとめウィキ
  2. AviUtl2のWiki
  3. R.E.P.O. 日本語解説Wiki
  4. シュガードール情報まとめウィキ
  5. 機動戦士ガンダム EXTREME VS.2 INFINITEBOOST wiki
  6. ソードランページ @ 非公式wiki
  7. シミュグラ2Wiki(Simulation Of Grand2)GTARP
  8. ドラゴンボール Sparking! ZERO 攻略Wiki
  9. 星飼いの詩@ ウィキ
  10. ヒカマーWiki
もっと見る
人気Wikiランキング

atwikiでよく見られているWikiのランキングです。新しい情報を発見してみよう!

  1. アニヲタWiki(仮)
  2. ストグラ まとめ @ウィキ
  3. ゲームカタログ@Wiki ~名作からクソゲーまで~
  4. 初音ミク Wiki
  5. 検索してはいけない言葉 @ ウィキ
  6. 発車メロディーwiki
  7. 機動戦士ガンダム バトルオペレーション2攻略Wiki 3rd Season
  8. Grand Theft Auto V(グランドセフトオート5)GTA5 & GTAオンライン 情報・攻略wiki
  9. オレカバトル アプリ版 @ ウィキ
  10. MadTown GTA (Beta) まとめウィキ
もっと見る
全体ページランキング

最近アクセスの多かったページランキングです。話題のページを見に行こう!

  1. 参加者一覧 - ストグラ まとめ @ウィキ
  2. 魔獣トゲイラ - バトルロイヤルR+α ファンフィクション(二次創作など)総合wiki
  3. 高崎線 - 発車メロディーwiki
  4. 鬼レンチャン(レベル順) - 鬼レンチャンWiki
  5. 暦 未羽 - ストグラ まとめ @ウィキ
  6. 召喚 - PATAPON(パタポン) wiki
  7. ステージ攻略 - パタポン2 ドンチャカ♪@うぃき
  8. 暦 いのん - ストグラ まとめ @ウィキ
  9. 鬼太郎誕生 ゲゲゲの謎 - アニヲタWiki(仮)
  10. ロスサントス警察 - ストグラ まとめ @ウィキ
もっと見る

  • このWikiのTOPへ
  • 全ページ一覧
  • アットウィキTOP
  • 利用規約
  • プライバシーポリシー

2019 AtWiki, Inc.