BGP Local,Dual-AS済
dual-asの存在理由についてはCCO参照
あかん例
iosv-1(config)#router bgp 200
iosv-1(config-router)#neighbor 10.1.1.1 remote-as 100
iosv-1(config-router)#network 2.2.2.2 mask 2
*Jun 24 13:44:24.376: %BGP-3-NOTIFICATION: sent to neighbor 10.1.1.1 passive 2/2 (peer in wrong AS) 2 bytes 0001
*Jun 24 13:44:24.378: %BGP-4-MSGDUMP: unsupported or mal-formatted message received from 10.1.1.1:
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0039 0104 0001 00B4 0101 0101 1C02 0601
0400 0100 0102 0280 0002 0202 0002 0246 0002 0641 0400 0000 01
*Jun 24 13:44:24.402: %BGP-3-NOTIFICATION: received from neighbor 10.1.1.1 active 2/8 (no supported AFI/SAFI) 3 bytes 0000005
・対向にlocal-asが設定されているときに、大本のAS番号を指定するとえらいこっちゃになるメモ
正しい例
iosv-0(config)#router bgp 100
iosv-0(config-router)#neighbor 10.1.1.2 remote-as 200
iosv-0(config-router)#neighbor 10.1.1.2 local-as 1
iosv-0(config-router)#neighbor 1.1.1.1 mask 255.255.255.255
iosv-0#sh ip bgp 2.2.2.2
BGP routing table entry for 2.2.2.2/32, version 3
Paths: (1 available, best #1, table default)
Not advertised to any peer
Refresh Epoch 1
1 200
10.1.1.2 from 10.1.1.2 (2.2.2.2)
Origin IGP, metric 0, localpref 100, valid, external, best
rx pathid: 0, tx pathid: 0x0
iosv-1(config)#router bgp 200
iosv-1(config-router)#neighbor 10.1.1.1 remote-as 1
iosv-1(config-router)#network 2.2.2.2 mask 255.255.255.255
iosv-1#sh ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 2
Paths: (1 available, best #1, table default)
Not advertised to any peer
Refresh Epoch 1
1 100
10.1.1.1 from 10.1.1.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
rx pathid: 0, tx pathid: 0x0
・iosv-1で設定したlocal-AS 1がそれぞれのパスに含まれている
no-prepend
iosv-0(config-router)#neighbor 10.1.1.2 local-as 1 no-prepend
iosv-0(config-router)#
*Jun 24 08:54:30.050: %BGP-5-NBR_RESET: Neighbor 10.1.1.2 reset (Local AS change)
*Jun 24 08:54:30.076: %BGP-5-ADJCHANGE: neighbor 10.1.1.2 Down Local AS change
*Jun 24 08:54:30.077: %BGP_SESSION-5-ADJCHANGE: neighbor 10.1.1.2 IPv4 Unicast topology base removed from session Local AS change
*Jun 24 08:54:30.915: %BGP-5-ADJCHANGE: neighbor 10.1.1.2 Up
iosv-0#sh ip bgp 2.2.2.2
BGP routing table entry for 2.2.2.2/32, version 5
Paths: (1 available, best #1, table default)
Not advertised to any peer
Refresh Epoch 1
200
10.1.1.2 from 10.1.1.2 (2.2.2.2)
Origin IGP, metric 0, localpref 100, valid, external, best
rx pathid: 0, tx pathid: 0x0
iosv-1#sh ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 5
Paths: (1 available, best #1, table default)
Not advertised to any peer
Refresh Epoch 1
1 100
10.1.1.1 from 10.1.1.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
rx pathid: 0, tx pathid: 0x0
・実際にやってみた所感、no-prepend設定後のピアの繋ぎなおしは超一瞬だった
・iosv-0ではlocal-AS 1が消滅し、パスが200のみになっている
replace-as
iosv-0(config-router)#neighbor 10.1.1.2 local-as 1 no-prepend replace-as
iosv-0(config-router)#
*Jun 24 09:03:24.536: %BGP-5-NBR_RESET: Neighbor 10.1.1.2 reset (Local AS change)
*Jun 24 09:03:24.563: %BGP-5-ADJCHANGE: neighbor 10.1.1.2 Down Local AS change
*Jun 24 09:03:24.565: %BGP_SESSION-5-ADJCHANGE: neighbor 10.1.1.2 IPv4 Unicast topology base removed from session Local AS change
*Jun 24 09:03:25.109: %BGP-5-ADJCHANGE: neighbor 10.1.1.2 Up
iosv-1#sh ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 7
Paths: (1 available, best #1, table default)
Not advertised to any peer
Refresh Epoch 1
1
10.1.1.1 from 10.1.1.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
rx pathid: 0, tx pathid: 0x0
・あ、そっちが消えるのね
・no-prependではlocal-ASが消え、replace-asでは大本のASが消滅
dual-as
iosv-0(config-router)#neighbor 10.1.1.2 local-AS 1 no-prepend replace-as dual-as
iosv-0(config-router)#
*Jun 24 09:11:10.488: %BGP-5-NBR_RESET: Neighbor 10.1.1.2 reset (Local AS change)
*Jun 24 09:11:10.507: %BGP-5-ADJCHANGE: neighbor 10.1.1.2 Down Local AS change
*Jun 24 09:11:10.509: %BGP_SESSION-5-ADJCHANGE: neighbor 10.1.1.2 IPv4 Unicast topology base removed from session Local AS change
iosv-0(config-router)#
*Jun 24 09:11:11.519: %BGP-3-NOTIFICATION: received from neighbor 10.1.1.2 active 2/2 (peer in wrong AS) 2 bytes 0064
*Jun 24 09:11:11.521: %BGP-5-NBR_RESET: Neighbor 10.1.1.2 active reset (BGP Notification received)
*Jun 24 09:11:11.530: %BGP-5-ADJCHANGE: neighbor 10.1.1.2 active Down BGP Notification received
*Jun 24 09:11:11.531: %BGP_SESSION-5-ADJCHANGE: neighbor 10.1.1.2 IPv4 Unicast topology base removed from session BGP Notification received
iosv-1(config)#router bgp 200
iosv-1(config-router)#no neighbor 10.1.1.1 remote-as 1
iosv-1(config-router)#
*Jun 24 14:51:08.047: %BGP-3-NOTIFICATION: sent to neighbor 10.1.1.1 6/3 (Peer De-configured) 0 bytes
iosv-1(config-router)#neighbo
*Jun 24 14:51:08.061: %BGP_SESSION-5-ADJCHANGE: neighbor 10.1.1.1 IPv4 Unicast topology base removed from session Neighbor deleted
*Jun 24 14:51:08.063: %BGP-5-ADJCHANGE: neighbor 10.1.1.1 Down Neighbor deleted
iosv-1(config-router)#neighbor 10.1.1.1 remote-as 100
iosv-1(config-router)#
*Jun 24 14:51:26.710: %BGP-5-ADJCHANGE: neighbor 10.1.1.1 Up
・あかん例で張った伏線がここで活きるなんて
・dual-asを設定することで、大本のASでもlocal-ASでもeBGPピアリングができるようになる
・ちなみに、no-prepend、replace-asを設定しているのでshow ip bgpに変化はない
ちなみに
iosv-0(config-router)#neighbor 10.1.1.2 local-as 1 dual-as
% dual-as not allowed without no-prepend/replace-as for eBGP local-as
・dual-asだけ設定しようとしてもno-prepend,replace-asを入れろと怒られる
参考
【BGP】Local-AS設定(local-as,no-prepend,replace-as,dual-as)動作確認 Cisco
Chapter: BGP Support for Dual AS Configuration for Network AS Migrations