04-01-2021 01:20 AM - edited 04-01-2021 01:23 AM
When I executed show mac address-table command for a node from APIC I got vlan,mac,interface information in the cli output.But when I executed API request in APIC for empMacEp command,I got mac and interface details only but no vlan information.Below is the sample example:
CLI output
---------
VLAN MAC Address Type age Secure NTFY Ports/SWID.SSID.LID
---------+-----------------+--------+---------+------+----+------------------
* 10 0050.5666.XXXX dynamic - F F po3
API Response
------------
{
"epmMacEp":{
"attributes":{
"addr":"00:50:56:66:XX:XX",
"childAction":"",
"createTs":"2020-09-22T18:58:50.516+00:00",
"dn":"topology/pod-X/node-XXX/sys/inst-overlay-X/bd-[vxlan-16777209]/db-ep/mac-00:50:56:66:XX:XX",
"flags":"local,mac",
"ifId":"po3",
"modTs":"never",
"name":"",
"pcTag":"any",
"status":""
}
}
}
So,I would like to know how to get the vlan details for corresponding mac/interface for a node in Cisco ACI using API
Thanks,
Deepak Ranjan Pati
04-01-2021 01:58 AM
Query the fvCEp class, and you will find the encap vlan as well.
Stay safe,
Sergiu
04-01-2021 03:11 AM
Hi Sergiu,
Thanks for the reply.I tried querying the class with existing command as below but it failed.
I tried with below API also which returned empty result.
https://<ip>:<port>/api/node/class/topology/pod-X/node-XXX/fvCEp.json
Can you please tell me what is the right way to send the request to APIC while quering fvCEp Class.
Thanks,
Deepak Ranjan Pati
04-01-2021 05:12 AM
Hi Deepak,
First, I just noticed that you are looking at "show mac address-table" output on the leaf switch. DO NOT use this command as it is not relevant in the ACI. Use the "show endpoint" command.
Second, I tested the class you are using "epmMacEp" and it should display the vlan as well:
Leaf202# moquery -c epmMacEp | grep dn dn : sys/inst-overlay-1/bd-[vxlan-16777209]/db-ep/mac-D4:6D:50:DC:10:1B dn : sys/ctx-[vxlan-2293761]/bd-[vxlan-16121799]/vlan-[vlan-121]/db-ep/mac-D4:6D:50:DC:10:1B dn : sys/ctx-[vxlan-2293761]/bd-[vxlan-16121799]/vlan-[vlan-120]/db-ep/mac-00:50:56:8A:75:99 dn : sys/ctx-[vxlan-2293761]/bd-[vxlan-16121799]/vlan-[vlan-120]/db-ep/mac-00:22:BD:F8:19:22 dn : sys/ctx-[vxlan-2293761]/bd-[vxlan-16121799]/vlan-[vlan-120]/db-ep/mac-88:F0:31:00:74:C9 dn : sys/ctx-[vxlan-2293761]/bd-[vxlan-16121799]/vlan-[vlan-120]/db-ep/mac-2C:D0:2D:C6:06:D6 dn : sys/ctx-[vxlan-2785282]/bd-[vxlan-15269819]/db-ep/mac-8C:60:4F:DD:95:C1
As you can see, there are 2 EP for which I do not have any vlan mentioned, and that is expected because:
1. D4:6D:50:DC:10:1B - is learned through overlay-1 VRF. This is how it looks in endpoint table:
7/overlay-1 vxlan-16777209 d46d.50dc.101b L eth1/1
2. 8C:60:4F:DD:95:C1 - is learned in vxlan
106/Tenant:VRF vxlan-15269819 8c60.4fdd.95c1 L eth1/23
Regarding the API call for fvCEp, you need to send it to APIC not to a Leaf.
Hope it helps,
Sergiu
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide