#!/bin/bash /usr/sbin/ip a \ | grep ether \ | grep -iohE '([0-9a-f]{2}[:-]){5}[0-9a-f]{2}' \ | tr -d : | sed 's/..../&\./g;s/\.$//' \ | grep -v ffff \ | while read mac; do # Find my MAC address in the cisco mac-table output. grep -iw "$mac" $0 | awk '{print $8}' done exit DC-MSPDC-N95K-Z1R7-01# sh mac address-table Legend: * - primary entry, G - Gateway MAC, (R) - Routed MAC, O - Overlay MAC age - seconds since last seen,+ - primary entry using vPC Peer-Link, (T) - True, (F) - False, C - ControlPlane MAC, ~ - vsan VLAN MAC Address Type age Secure NTFY Ports ---------+-----------------+--------+---------+------+----+------------------ * 3205 0002.c906.1957 dynamic 0 F F Eth1/13/1 * 3205 000a.f7df.c779 dynamic 0 F F Eth2/13/4 * 3205 0021.5ad4.d6ad dynamic 0 F F Eth1/13/3 * 3205 0021.5aed.fcf5 dynamic 0 F F Eth1/13/3 * 3205 0023.7ddb.e34d dynamic 0 F F Eth1/13/3 * 3205 0023.7ddb.ea27 dynamic 0 F F Eth1/13/3 * 3205 0023.7ddc.5dd3 dynamic 0 F F Eth1/13/3 * 3205 0023.7ddc.5f13 dynamic 0 F F Eth1/13/3 * 3205 0023.7ddc.6057 dynamic 0 F F Eth1/13/3 * 3205 0023.7ddc.6267 dynamic 0 F F Eth1/13/3 * 3205 0023.7ddc.630d dynamic 0 F F Eth1/13/3 * 3205 0023.7ddc.63b3 dynamic 0 F F Eth1/13/3 * 3205 0023.7ddc.b713 dynamic 0 F F Eth1/13/3 * 3205 0023.7ddc.b729 dynamic 0 F F Eth1/13/3 * 3205 0023.7ddc.ba53 dynamic 0 F F Eth1/13/3 * 3205 0023.7ddc.bcbd dynamic 0 F F Eth1/13/3 * 3205 0023.7ddc.bdad dynamic 0 F F Eth1/13/3 * 3205 0023.7ddc.bfd9 dynamic 0 F F Eth1/13/3 * 3205 0024.81e0.cc85 dynamic 0 F F Eth1/13/3 * 3205 0024.81e0.ceb9 dynamic 0 F F Eth1/13/3 * 3205 0024.81e0.cfa1 dynamic 0 F F Eth1/13/3 * 3205 0024.81e0.d0ed dynamic 0 F F Eth1/13/3 * 3205 0024.81e0.d2dd dynamic 0 F F Eth1/13/3 * 3205 0024.81e0.d671 dynamic 0 F F Eth1/13/3 * 3205 0024.81e0.d89b dynamic 0 F F Eth1/13/3 * 3205 0024.81e0.d953 dynamic 0 F F Eth1/13/3 * 3205 0024.81e0.d9ff dynamic 0 F F Eth1/13/3 * 3205 0024.81e0.dd4b dynamic 0 F F Eth1/13/3 * 3205 0024.81e0.defd dynamic 0 F F Eth1/13/3 * 3205 0024.81e0.df41 dynamic 0 F F Eth1/13/3 * 3205 0024.81e0.df6f dynamic 0 F F Eth1/13/3 * 3205 0024.81e0.e067 dynamic 0 F F Eth1/13/3 * 3205 0024.81e0.e203 dynamic 0 F F Eth1/13/3 * 3205 0024.81e0.e5cd dynamic 0 F F Eth1/13/3 * 3205 0024.81e0.e671 dynamic 0 F F Eth1/13/3 * 3205 0024.81e1.05cd dynamic 0 F F Eth1/13/3 * 3205 0024.81e1.0baf dynamic 0 F F Eth1/13/3 * 3205 0024.81e1.1f81 dynamic 0 F F Eth1/13/3 * 3205 0024.81e1.4d93 dynamic 0 F F Eth1/13/3 * 3205 0024.81e1.4e41 dynamic 0 F F Eth1/13/3 * 3205 0024.81e1.527d dynamic 0 F F Eth1/13/3 * 3205 0024.81e7.3575 dynamic 0 F F Eth1/13/3 * 3205 0024.81e7.35b3 dynamic 0 F F Eth1/13/3 * 3205 0024.81e7.36db dynamic 0 F F Eth1/13/3 * 3205 0024.81e7.3735 dynamic 0 F F Eth1/13/3 * 3205 0024.81e7.39db dynamic 0 F F Eth1/13/3 * 3205 0024.81e7.6063 dynamic 0 F F Eth1/13/3 * 3205 0024.81e7.6217 dynamic 0 F F Eth1/13/3 * 3205 0024.81e9.42eb dynamic 0 F F Eth1/13/3 * 3205 0024.81e9.4a89 dynamic 0 F F Eth1/13/3 * 3205 0024.81e9.4af7 dynamic 0 F F Eth1/13/3 * 3205 0025.b320.3483 dynamic 0 F F Eth1/13/3 * 3205 0025.b320.35c3 dynamic 0 F F Eth1/13/3 * 3205 0025.b324.40cf dynamic 0 F F Eth1/13/3 * 3205 0025.b324.440f dynamic 0 F F Eth1/13/3 * 3205 0025.b324.442f dynamic 0 F F Eth1/13/3 * 3205 0025.b3e0.5bd1 dynamic 0 F F Eth1/13/3 * 3205 0025.b3e0.5c01 dynamic 0 F F Eth1/13/3 * 3205 0025.b3e0.637d dynamic 0 F F Eth1/13/3 * 3205 02a0.98f4.c146 dynamic 0 F F Po105 * 3205 02a0.98f4.c2fe dynamic 0 F F Po108 * 3205 02a0.98f4.ca06 dynamic 0 F F Po107 * 3205 02a0.98f4.d2b2 dynamic 0 F F Po106 * 3205 02a0.98fa.cb0a dynamic 0 F F Po102 * 3205 02a0.98fa.d214 dynamic 0 F F Po104 * 3205 02a0.98fa.d8a4 dynamic 0 F F Po101 * 3205 02a0.98fa.e300 dynamic 0 F F Po103 * 3205 18a9.055d.deb9 dynamic 0 F F Eth1/13/3 * 3205 441e.a117.3418 dynamic 0 F F Eth2/13/2 * 3205 98be.9467.8c9c dynamic 0 F F Eth1/32 * 3205 98be.9467.eec4 dynamic 0 F F Eth1/32 * 3205 a036.9f1d.c12e dynamic 0 F F Eth1/13/3 * 3205 a036.9f35.ea48 dynamic 0 F F Eth2/13/1 * 3205 b026.2833.be50 dynamic 0 F F Eth1/13/2 * 3205 b859.9f2f.b678 dynamic 0 F F Eth1/16 * 3205 b859.9f2f.b698 dynamic 0 F F Eth2/16 * 3205 b8ce.f604.9d80 dynamic 0 F F Eth2/15 * 3205 b8ce.f604.a60c dynamic 0 F F Eth1/15 * 3205 d239.ea1b.6618 dynamic 0 F F Po120 * 3205 d239.ea1e.c992 dynamic 0 F F Po120 * 3205 d239.ea1f.33ca dynamic 0 F F Po120 * 3205 d239.ea1f.c514 dynamic 0 F F Po120 * 3205 d239.ea1f.c573 dynamic 0 F F Po120 * 3205 d239.ea1f.c845 dynamic 0 F F Po120 * 3205 d239.ea1f.cc89 dynamic 0 F F Po120 * 3205 d239.ea1f.ce58 dynamic 0 F F Po120 * 3205 d239.ea1f.ce91 dynamic 0 F F Po120 * 3205 d239.ea1f.d005 dynamic 0 F F Po120 * 3205 d8d3.85ae.823d dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.8277 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.8c39 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9c8f dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9cbd dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9ccf dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9df1 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9e27 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9e51 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9e5f dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9e65 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9e77 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9e89 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9e93 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9ea5 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9ecf dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9ee1 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9eed dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9efd dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9f4b dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9f51 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9f57 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9f63 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9f73 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9f75 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9f93 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9f97 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9f9d dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9f9f dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9fa3 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9fa5 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9fbd dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9fc1 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9fcd dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9fd5 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9fd9 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9fdb dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9fe5 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9feb dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9fed dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9ff1 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9ff3 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9ff7 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.9ffd dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a003 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a009 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a00f dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a071 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a127 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a129 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a135 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a13b dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a163 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a169 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a16b dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a1a1 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a1b1 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a1bf dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a1d1 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a1f3 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a209 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a20f dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a215 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a269 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a26f dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a2f5 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a37d dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a39b dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a41d dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a435 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a443 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a449 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ae.a45b dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.2fa7 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.2fab dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.2fb1 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.2fbf dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.2fcf dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.2fd1 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.2fdb dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.2fe1 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.2fe7 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.2fe9 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.2fef dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.2ff3 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.2ff5 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.300b dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.301d dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.3039 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.3041 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.3053 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.305d dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.305f dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.3069 dynamic 0 F F Eth1/13/3 * 3205 d8d3.85ff.6e87 dynamic 0 F F Eth1/13/3 * 3206 02a0.98f4.c146 dynamic 0 F F Po105 * 3206 02a0.98f4.c2fe dynamic 0 F F Po108 * 3206 02a0.98f4.ca06 dynamic 0 F F Po107 * 3206 02a0.98f4.d2b2 dynamic 0 F F Po106 * 3206 02a0.98fa.cb0a dynamic 0 F F Po102 * 3206 02a0.98fa.d214 dynamic 0 F F Po104 * 3206 02a0.98fa.d8a4 dynamic 0 F F Po101 * 3206 02a0.98fa.e300 dynamic 0 F F Po103 * 3206 b026.2833.bfe0 dynamic 0 F F Po118 * 3206 b026.2833.c050 dynamic 0 F F Po118 * 3206 b026.2833.c120 dynamic 0 F F Po118 * 3206 b026.2833.c7e0 dynamic 0 F F Po118 * 3206 b026.2833.d470 dynamic 0 F F Po118 * 3206 f8f2.1e7e.f860 dynamic 0 F F Po118 * 3206 f8f2.1e7e.fe70 dynamic 0 F F Po118 * 3207 b8ca.3a6c.4038 dynamic 0 F F Eth2/13/3 * 3207 d239.ea1b.6618 dynamic 0 F F Po120 * 3207 d239.ea1e.c992 dynamic 0 F F Po120 * 3207 d239.ea1f.33ca dynamic 0 F F Po120 * 3207 d239.ea1f.c514 dynamic 0 F F Po120 * 3207 d239.ea1f.c573 dynamic 0 F F Po120 * 3207 d239.ea1f.c845 dynamic 0 F F Po120 * 3207 d239.ea1f.cc89 dynamic 0 F F Po120 * 3207 d239.ea1f.ce58 dynamic 0 F F Po120 * 3207 d239.ea1f.ce91 dynamic 0 F F Po120 * 3207 d239.ea1f.d005 dynamic 0 F F Po120 * 3207 e443.4b45.8b30 dynamic 0 F F Eth1/13/4 * 3209 0216.e192.b247 dynamic 0 F F Po122 * 3209 02a0.98f4.c146 dynamic 0 F F Po105 * 3209 02a0.98f4.c2fe dynamic 0 F F Po108 * 3209 02a0.98f4.ca06 dynamic 0 F F Po107 * 3209 02a0.98f4.d2b2 dynamic 0 F F Po106 * 3209 02a0.98fa.cb0a dynamic 0 F F Po102 * 3209 02a0.98fa.d214 dynamic 0 F F Po104 * 3209 02a0.98fa.d8a4 dynamic 0 F F Po101 * 3209 02a0.98fa.e300 dynamic 0 F F Po103 * 3209 06fd.7fc4.4747 dynamic 0 F F Po122 * 3209 0ed1.d345.1c47 dynamic 0 F F Po122 * 3209 16cb.dcc2.e543 dynamic 0 F F Po122 * 3209 1e00.8000.0061 dynamic 0 F F Po122 * 3209 1e00.fc00.0016 dynamic 0 F F Po122 * 3209 2272.4f7d.5d49 dynamic 0 F F Po122 * 3209 2a49.56fd.8748 dynamic 0 F F Po122 * 3209 32e5.3b55.124a dynamic 0 F F Po122 * 3209 3e8f.c19d.fb40 dynamic 0 F F Po122 * 3209 421d.86a3.1a41 dynamic 0 F F Po122 * 3209 42a7.505b.ce47 dynamic 0 F F Po122 * 3209 5e3c.0e5b.1e49 dynamic 0 F F Po122 * 3209 6220.8073.6c4f dynamic 0 F F Po122 * 3209 6eda.f80b.a44e dynamic 0 F F Po122 * 3209 82af.d4e9.4543 dynamic 0 F F Po122 * 3209 96df.0d87.2e49 dynamic 0 F F Po122 * 3209 a2f3.0ca2.8044 dynamic 0 F F Po122 * 3209 a645.855e.d44d dynamic 0 F F Po122 * 3209 aa0c.31dd.a44d dynamic 0 F F Po122 * 3209 ae66.fbe4.c741 dynamic 0 F F Po122 * 3209 c6a2.d315.cb4e dynamic 0 F F Po122 * 3209 cac1.9bbb.ee44 dynamic 0 F F Po122 * 3209 d6e5.abff.2d40 dynamic 0 F F Po122 * 3209 de8e.1e44.7541 dynamic 0 F F Po122 * 3209 e21e.3f4a.2446 dynamic 0 F F Po122 * 3209 e26a.b5d0.bd4a dynamic 0 F F Po122 * 3209 e63e.c063.8d49 dynamic 0 F F Po122 * 3209 fa2b.5d93.6c43 dynamic 0 F F Po122 * 3209 fe99.abb9.7549 dynamic 0 F F Po122 G - 2cf8.9b47.ed3f static - F F sup-eth1(R)