目次
はじめに
こんにちは。ネットワークエンジニアの「だいまる」です。
今回はBGP Attributeシリーズとして、「Origin」をまとめていきたいと思います。
Originとは?
概要
BGPのAttribute(属性)の1つである「Origin」は、「経路が何で生成されたのかを示す」ために利用します。
主に「IGP」、「EGP」、「Incomplete」の3つがあり、現場では「IGP」と「Incomplete」の2つが使われており、「EGP」はほとんど使われていないと思います。
| 優先度 | 種類 | 理由 |
|---|---|---|
| 1 | IGP | IGPからBGPに広報された経路 |
| 2 | EGP | レガシーなEGPプロトコルによって広報された経路 |
| 3 | Incomplete | 生成元が不明な経路 |
設定方法(Cisco IOS)
Originを意図的に変更するには、Prefix-ListやRoute-mapを利用して変更することができます。
#prefix-listの定義
ip prefix-list <リスト名> permit <IP Range>/<prefix>
#route-mapの定義
route-map <マップ名> permit 10
match ip address prefix-list <リスト名>
set origin <igp|incomplete>
#BGPへの設定適用
router bgp <AS番号>
neighbor <NeighborのIPアドレス> route-map <マップ名> [in|out]
動作確認
事前確認(Router8)
BGPテーブルを見ると全ての経路は「IGP(i)」になっていることがわかります。
Router8#show ip bgp
BGP table version is 31, local router ID is 10.30.8.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,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 10.10.1.1/32 192.168.3.1 0 100 i
*> 10.10.2.1/32 192.168.3.1 0 0 100 i
*> 10.10.3.1/32 192.168.3.1 0 100 i
*> 10.10.4.1/32 192.168.3.1 0 100 i
*> 10.20.5.1/32 192.168.3.1 0 100 200 i
*> 10.20.6.1/32 192.168.3.1 0 100 200 i
*> 10.20.7.1/32 192.168.3.1 0 100 200 i
*> 10.40.9.1/32 192.168.3.1 0 100 400 i
* 192.168.4.1 0 200 200 200 200 100 400 i
*> 10.40.19.1/32 192.168.3.1 0 100 400 i
* 192.168.4.1 0 200 200 200 200 100 400 i
設定変更(Router8)
以下コマンドで設定を変更します。
Router8#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router8(config)#ip prefix-list Origin seq 10 permit 10.40.19.1/32
Router8(config)#route-map Origin_Add permit 10
Router8(config-route-map)#match ip address prefix-list Origin
Router8(config-route-map)#set origin incomplete
Router8(config-route-map)#exit
Router8(config)#router bgp 300
Router8(config-router)#neighbor 192.168.4.1 route-map Origin_Add in
Router8(config-router)#end
事後確認(Router8)
状態が「i」から「?」に変更されていることがわかります。
Router8#show ip bgp
BGP table version is 37, local router ID is 10.30.8.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,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 10.10.1.1/32 192.168.3.1 0 100 i
*> 10.10.2.1/32 192.168.3.1 0 0 100 i
*> 10.10.3.1/32 192.168.3.1 0 100 i
*> 10.10.4.1/32 192.168.3.1 0 100 i
*> 10.20.5.1/32 192.168.3.1 0 100 200 i
*> 10.20.6.1/32 192.168.3.1 0 100 200 i
*> 10.20.7.1/32 192.168.3.1 0 100 200 i
*> 10.40.9.1/32 192.168.3.1 0 100 400 i
*> 10.40.19.1/32 192.168.3.1 0 100 400 i
* 192.168.4.1 0 200 100 400 ?
最後に
今回もBGPのAttribute(属性)の1つである「Origin」についてまとめました。
この記事でみなさんの理解を少しでも深めることができていれば幸いです。


