简介
本文档介绍在ACI上启用域验证功能时,从枝叶交换机的APIC CLI删除所有静态端口绑定的影响。
先决条件
基本了解应用中心基础设施(ACI)配置和域验证功能。
有关ACI中域验证功能的详细信息,请访问:
https://www.cisco.com/c/en/us/support/docs/software/aci-data-center/221206-understand-aci-enforce-domain-validation.html#:~:text=13%201%2C19-,Enforce%20Domain%20Validation%3A%20Enabled,NOT%20programmed%20on%20the%20interface。
设置和拓扑
在此设置中,您将使用两种不同的方法对ACI枝叶交换机接口上的Vlan进行编程
- 连接到枝叶01端口接口策略组(IPG)的可附加访问实体配置文件(AAEP)已使用终端策略组(EPG)映射进行配置。
- 连接到Leaf04端口IPG的AAEP没有任何EPG映射,但会通过CLI执行“静态端口绑定”以推送Vlan。
2个枝叶- 01和04 ,
型号:N9K-C93180YC-FX
- IPG策略:ipg_1
- aaep1(用于枝叶01)
- system-cdp-enabled
- system-lldp-enabled
- IPG策略:ipg_2
- aaep_static(用于Leaf04)
- system-cdp-enabled
- system-lldp-enabled
- 枝叶接口选择器:Leaf_101_interface_profile
- 枝叶接口选择器:Leaf_104_interface_profile
- 交换机配置文件:Leaf_101
- 枝叶101
- Leaf_101_interface_profile
- 交换机配置文件:Leaf_104
- 枝叶104
- Leaf_104_interface_profile
- 租户:abc-tn,应用配置文件:abc-ap,EPG:epg-1,BD:bd-1
- 物理域:abc-dom,Vlan池:静态:abc-vlan-pool(150-152)
- Domain sample-dom映射到EPG epg-1

案例研究
在本实验中,您将观察从NXOS® CLI删除静态端口绑定的影响。本文档中的行为将向您显示“当您从NXOS® CLI(仅CLI)删除所有静态端口映射时,APIC将从EPG中删除物理域”。根据当前CLI设计,移除最后一个静态端口时,会清除物理域与EPG之间的关联。这是为了保持最佳配置以及在某些情况下避免重叠vlan。这与通过GUI/API完成的配置无关。
此行为仅会影响ACI交换矩阵,其中配置设计涉及部署静态端口附件和EPG到同一EPG下混合的AEP关联,这种情况并不常见。
如果从EPG中删除物理域并在交换矩阵中启用域验证功能,则APIC将从EPG接口删除所有vlan。
此问题已在Cisco bug ID CSCwj74262 Changes to the current expected behavior about config clean-up under the CLI config)中解决
涉及的步骤
第 1 步:确保已启用域验证。
apic1# moquery -c infraSetPol | egrep "domainValidation"
domainValidation : yes
如果场景中禁用了域验证,则从EPG中删除物理域关联不会产生任何影响,并且不会从枝叶接口删除VLAN。
第 2 步由于AAEP到EPG的映射,在枝叶101上对VLAN进行编程。
apic1# fabric 101 show vlan encap-id 151
----------------------------------------------------------------
Node 101 (bgl-aci07-leaf01)
----------------------------------------------------------------
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
14 abc-tn:abc-ap:epg-1 active Eth1/8, Eth1/9
VLAN Type Vlan-mode
---- ----- ----------
14 enet CE
第3步:没有为枝叶104编程VLAN,因为未完成静态映射。
apic1# fabric 104 show vlan encap-id 151
----------------------------------------------------------------
Node 104 (leaf04)
----------------------------------------------------------------
++ No vlan programmed
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
VLAN Type Vlan-mode
---- ----- ----------
第3步:从APIC CLI在枝叶104上进行NXOS®样式配置
apic1(config)# leaf 104
apic1(config-leaf)# interface eth 1/8-9
apic1(config-leaf-if)# switchport trunk allowed vlan 151 tenant abc-tn application abc-ap epg epg-1 <<== add static path binding
第4步:已创建APIC fvIfConn MO验证
apic1# moquery -c fvIfConn | grep dn | grep abc
dn : uni/epp/fv-[uni/tn-abc-tn/ap-abc-ap/epg-epg-1]/node-101/attEntitypathatt-[abc-aaep]/conndef/conn-[vlan-151]-[0.0.0.0] <<<=== MO created due to EPG to AAEP Mapping
dn : uni/epp/fv-[uni/tn-abc-tn/ap-abc-ap/epg-epg-1]/node-104/stpathatt-[eth1/8]/conndef/conn-[vlan-151]-[0.0.0.0] <<<==== MO created due to static port binding in step 3
dn : uni/epp/fv-[uni/tn-abc-tn/ap-abc-ap/epg-epg-1]/node-104/stpathatt-[eth1/9]/conndef/conn-[vlan-151]-[0.0.0.0]
第5步:已从节点104删除配置
apic1(config-leaf)# interface eth 1/8-9
apic1(config-leaf-if)# no switchport trunk allowed vlan 151 tenant abc-tn application abc-ap epg epg-1 <<== Delete static path binding
apic1(config-leaf-if)#
步骤6.由于通过CLI删除配置时在后端触发的清理脚本,已删除域。

第7步:由于强制验证功能,已删除VLAN编程(由于域未与EPG关联,因此VLAN不会编程)
apic1# fabric 101 show vlan encap-id 151
----------------------------------------------------------------
Node 101 (leaf01)
----------------------------------------------------------------
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
++ vlan got removed
VLAN Type Vlan-mode
---- ----- ----------