[toc:faq]
フォント等がくずれて見辛い場合は Cisco Learning Network の同ドキュメントもご参照ください。
外部 L3 接続の簡易設定 (BGP)
概要
本ドキュメントでは BGP を用いた L3 out の動作確認を目的とした、最小限の構成の簡易設定例をご紹介します。
注意:商用環境等でご利用いただく際には本ドキュメントではなく Cisco.com のコンフィギュレーションガイド等をご確認の上、適切な設定をご検討ください。
本ドキュメントで使用している APIC バージョンは 2.2(1n) となります。
構成

<通信確認用の N9K stand-alone について>
対向接続機器に通信確認用の N9K stand-alone を用いています。一台のスイッチに BGP接続ルータ(RP_Ent_VRF) と ACI内のホスト(RP_Int_VRF) を疑似するVRFを分けていますが、通信確認用のルータ・ホストをそれぞれ用意できるようであれば VRF は不要です。
以下ドキュメントのように Leaf スイッチを NX-OS モードに変更することで流用可能です。
ACI モードの Nexus9300 を NX-OS モードにする手法
N9K 以外の Nexus シリーズや IOS ルータを用いて代用することも可能ですが、 IOS ルータでは後述の設定例が大きく異なりますのでご注意ください。
設定の目的
本ドキュメントの設定はACIファブリック内の疑似ホスト(172.16.1.1@RP_Int_VRF) から、 BGP により接続された L3 Out を経由し、疑似外部ネットワーク (112.1.1.1@RP_Ent_VRF) との ping 通信を成功することを目的としています。
手順1. ACI ファブリック共通設定
1-1. Route Reflector の設定 (省略可)
- Fabric > Fabric Policies > Pod Policies > Policies > BGP Route Reflector default
Autonomous System Number: 100
- Create Route REflector Node Policy Ep
Spine Node: 201
- Fabric > Fabric Policies > Pod Policies > Policy Groups > Create Pod Policy Group
Name: Pod_Policy_default
BGP Rout Reflector Policy: default
- Fabric > Fabric Policies > Pod Policies > Profiles > Pod Profile default > Pod Selectors
Name: pod1-profile
Blocks: 1
Policy Group: Pod_Policy_default
1-2. Fabric Access の設定
- Fabric > Access Policies > Pools > VLAN > Create VLAN Pool
Name: RP_VLAN
- Create Ranges
Range: VLAN 100 - VLAN 200
- Fabric > Access Policies > Physical and External Domains > Physical Domains > Create Physical Domain
Name: RP_Domain
VLAN Pool: RP_VLAN
Associated Attachable Entity Profile: Create Attachable Access Entity Profile
- Create Attachable Access Entity Profile
Name: RP_AEP
- Fabric > Access Policies > Interface Policies > Policy Groups > Leaf Policy Groups > Create Leaf Access Port Policy Group
Name: RP_Port_Policy
Attached Entity Profile: RP_AEP
- Fabric > Access Policies > Interface Policies > Profiles > Leaf Profiles > Create Leaf Interface Profile
Name: RP_IF
- Create Interface Selectors
Name: RP_Port
Interface IDs: 1/9
Interface Policy Group: RP_Port_Policy
- Fabric > Access Policies > Switch Policies > Profiles > Leaf Profiles > Create Leaf Profiles
<1.Profile>
Name: RP_Leaf
[Leaf Selectors]
Name: RP_Leaf101
Blocks: 101
<2.Associations>
Interface Selector Profiles: RP_IF
1-3. Tenant の設定 (省略可)
- (Optional) Tenants > Crate Tenant
Name: RP_demo
VRF Name: RP_VRF
- Tenants > Networking > Bridge Domains > Create Bridge Domain
<1.Main>
Name: RP_BD
VRF: RP_demo/RP_VRF
<2.L3 Configurations>
(Click) Subnets > Create Subnet
Gateway IP: 172.16.1.254/24
(Check) Advertised Externally
<3.Advanced/Troubleshooting>
Skip
1-4. ACI ファブリック内のホスト接続用の EPG 設定
- Tenants > Application Profiles > Create Application Profiles
Name: RP_Applications
[EPG]
Name: RP_Int_EPG
BD: RP_BD
Domain: RP_Domain
Static Path: 101/1/9
Static Path VLAN: vlan-111
1-5. (対向機器側) ACI Fabric 内 ホスト側の設定
- ACI側 VRF のネットワーク設定
- vlan 111
- vrf context RP_Int_VRF
- ip route 0.0.0.0/0 172.16.1.254
-
- interface Ethernet1/41
- switchport
- switchport mode trunk
- switchport trunk allowed vlan 111
-
- interface Vlan111
- no shutdown
- mac-address 0000.0000.0111
- vrf member RP_Int_VRF
- ip address 172.16.1.1/24
- ACI ファブリック内 Bridge Domain のゲートウェイに対して ping 通信を確認
- # ping 172.16.1.254 vrf RP_Int_VRF
- PING 172.16.1.254 (172.16.1.254): 56 data bytes
- 64 bytes from 172.16.1.254: icmp_seq=0 ttl=62 time=0.817 ms
- 64 bytes from 172.16.1.254: icmp_seq=1 ttl=62 time=0.569 ms
- 64 bytes from 172.16.1.254: icmp_seq=2 ttl=62 time=0.564 ms
- 64 bytes from 172.16.1.254: icmp_seq=3 ttl=62 time=0.595 ms
- 64 bytes from 172.16.1.254: icmp_seq=4 ttl=62 time=0.533 ms
手順2. iBGP Peer 設定
2-1. iBGP Node/IF 設定
Tenants > Networking > External Routed Networks > Create Routed Outside
- Identity
Name: iBGP_demo
VRF: RP_demo/RP_VRF
(Check) BGP
(Click) Node And Interface Protocol Profiles
<Create Node Profile>
Name: iBGP_Node
- (Click) Nodes > Select Node
Node ID: topology/pod-1/node-102
Router ID: 1.1.1.1
(Click) Static Route
<Create Static Route>
Prefix: 2.2.2.2/32
Next Hop Addresses: 192.168.1.2
- (Click) Interface Profiles > Create Interface Profile
<1. Identity>
Name: iBGP_IF
<2. Protocol Profiles>
Skip
<3. Interfaces>
(Select) SVI
(Click) SVI Interfaces
<Select SVI>
Path: topology/pod-1/paths-102/patheup-[eth1/9]
Encap: VLAN 112
IPv4 Primary / IPv6 Preferred Address: 192.168.1.1/24
- External EPG Networks
(Click) External EPG Networks
<Create External Network>
Name: Ext_Network
(Click) Subnet
<Create Subnet>
IP Address: 0.0.0.0/0
2-2. (対向機器側) Interface 設定
- N9K Stand-alone の設定
- vlan 112
- vrf context RP_Ext_VRF
-
- interface Ethernet1/42
- switchport
- switchport mode trunk
- switchport trunk allowed vlan 112
-
- interface Vlan112
- no shutdown
- mac-address 0000.0000.0112
- vrf member RP_Ext_VRF
- ip address 192.168.1.2/24
- ping による IF の接続性確認
- # ping 192.168.1.1 vrf RP_Ext_VRF
- PING 192.168.1.1 (192.168.1.1): 56 data bytes
- 64 bytes from 192.168.1.1: icmp_seq=0 ttl=62 time=0.717 ms
- 64 bytes from 192.168.1.1: icmp_seq=1 ttl=62 time=0.434 ms
- 64 bytes from 192.168.1.1: icmp_seq=2 ttl=62 time=0.435 ms
- 64 bytes from 192.168.1.1: icmp_seq=3 ttl=62 time=0.438 ms
- 64 bytes from 192.168.1.1: icmp_seq=4 ttl=62 time=0.619 ms
2-3. iBGP peer の確立と外部ネットワークのインポート
- Tenants > Network > External Routed Networks > iBGP_demo > Logical Node Profiles > iBGP_Node > BGP Peer Connectivity > loopback ( select the "interface" if it's eBGP peer)
Peer Address: 2.2.2.2
Remote Autonomous System Number: 100
- (対向機器側) N9K Stand-alone の BGP 設定
- feature bgp
- vrf context RP_Ext_VRF
- ip route 1.1.1.1/32 192.168.1.1
-
- interface loopback2
- vrf member RP_Ext_VRF
- ip address 2.2.2.2/32
-
- interface loopback112
- vrf member RP_Ext_VRF
- ip address 112.1.1.1/32
-
- router bgp 10
- vrf RP_Ext_VRF
- local-as 100
- address-family ipv4 unicast
- network 112.1.1.1/32
- neighbor 192.168.1.1
- remote-as 100
- address-family ipv4 unicast
- neighbor 1.1.1.1
- remote-as 100
- update-source loopback2
- address-family ipv4 unicast
- BGP Peer が確立していることを確認

- 外部ネットワークアドレスが ACI 側へインポートされていることを確認

- (省略可能) 外部ネットワークアドレスが ACI ファブリック内の MP-BGP を経由し、Leaf101 で受信していることを確認
Leaf101 へ ssh ログインし、show ip route を確認
- leaf101# show ip route vrf RP_demo:RP_VRF
- 1.1.1.1/32, ubest/mbest: 1/0
- *via 10.0.248.27%overlay-1, [1/0], 5d18h, bgp-100, internal, tag 100
- 112.1.1.1/32, ubest/mbest: 1/0
- *via 10.0.248.27%overlay-1, [200/128576], 5d18h, bgp-100, internal, tag 100
- 172.16.1.0/24, ubest/mbest: 1/0, attached, direct, pervasive
- *via 10.0.112.65%overlay-1, [1/0], 02w19d, static
- 172.16.1.254/32, ubest/mbest: 1/0, attached, pervasive
- *via 172.16.1.254, vlan24, [1/0], 02w19d, local, local
- 192.168.1.0/24, ubest/mbest: 1/0
- *via 10.0.248.27%overlay-1, [200/0], 5d18h, bgp-100, internal, tag 100
手順3. Contract の設定
3-1. Contract の作成
- Tenants > Security Policies > Contracts > Create Contract
Name: BGP_Contract
- Create Contract Subject
Name: BGP_Subject
Filters: icmp
3-2. EPG へ Contract の割り当て
- Tenants > Application Profiles > RP_Application > Appliction EPGs > Contracts > Add Provided Contract
Contract: RP_demo/BGP_contract
3-3. BGP へ Contract の割り当て
- Tenants > Networking > External Routed Networks > iBGP_demo > Networks > Ext_Network > Contracts > Consumed Contracts
Name: BGP_contract
Tenant: RP_demo
3-4. BD へ L3Out の割り当て
- Tenants > Networking > Bridge Domains > RP_BD > L3 Configurations
Associated L3 Outs: iBGP_demo
3-5. (対向機器側) BGP 接続ルータ側で ACI ファブリック内経路を受信していることを確認
- # show ip route vrf RP_Ext_VRF
- IP Route Table for VRF "RP_Ext_VRF"
-
- 1.1.1.1/32, ubest/mbest: 1/0
- *via 192.168.1.1, [1/0], 03:14:11, static
- 2.2.2.2/32, ubest/mbest: 2/0, attached
- *via 2.2.2.2, Lo2, [0/0], 03:13:15, local
- *via 2.2.2.2, Lo2, [0/0], 03:13:15, direct
- 112.1.1.1/32, ubest/mbest: 2/0, attached
- *via 112.1.1.1, Lo112, [0/0], 02:12:14, local
- *via 112.1.1.1, Lo112, [0/0], 02:12:14, direct
- 172.16.1.0/24, ubest/mbest: 1/0
- *via 1.1.1.1, [200/0], 00:07:37, bgp-10, internal, tag 100
- 192.168.1.0/24, ubest/mbest: 1/0, attached
- *via 192.168.1.2, Vlan112, [0/0], 15:33:42, direct
- 192.168.1.2/32, ubest/mbest: 1/0, attached
- *via 192.168.1.2, Vlan112, [0/0], 15:33:42, local
3-6. (対向機器側) ACIファブリック内ホストから外部ネットワークへ ping による通信確認
- # ping 112.1.1.1 vrf RP_Int_VRF
- PING 112.1.1.1 (112.1.1.1): 56 data bytes
- 64 bytes from 112.1.1.1: icmp_seq=0 ttl=251 time=0.808 ms
- 64 bytes from 112.1.1.1: icmp_seq=1 ttl=251 time=0.687 ms
- 64 bytes from 112.1.1.1: icmp_seq=2 ttl=251 time=0.619 ms
- 64 bytes from 112.1.1.1: icmp_seq=3 ttl=251 time=0.656 ms
- 64 bytes from 112.1.1.1: icmp_seq=4 ttl=251 time=0.601 ms
設定画面キャプチャ
<1-1>

<1-2-1>
<1-2-3>

<1-2-5>
<1-2-6>
<1-2-8>
<1-3>

<1-4>
<2-1-1>

<2-1-1-1>
<2-1-1-2>
<2-1-2>
<2-3-1>
<3-1>
<3-2>