Hello Javier
The short answer is: it depends
. Most IOS- and IOS-XE-based switches don’t support it, with some exceptions, depending on the IOS version numbers (i.e., some 65XX, 68XX, 45XX, 48XX series switches do support it). Nexus switches do support it as seen here.
There are several reasons for its limited support. First of all, port security is typically used for ports connected to end devices such as PCs, laptops, and IP telephones. It is rare to have a port channel configured on one of these. You may of course have a server that uses portchannel, but these are typically in secured datacenters, and are not swapped out often to warrent the use of port security.
Secondly, there are some issues when attempting to configure port security on a port channel. Port security tracks source MAC addresses per physical port. With EtherChannel load-balancing, a single MAC can legitimately appear on different members over time, which conflicts with how port-security enforces MAC pinning. For this reason, Cisco disables it on EtherChannel ports on most IOS/IOS-XE platforms.
NX-OS has a feature port-security that supports limiting/learning MACs on Layer-2 interfaces, including Port-channel interfaces, on many Nexus models and releases. However there are some typically caveats:
- Not supported on the vPC peer-link.
- Behavior and support of sticky MAC on Port-channels vary by release.
- For vPC member Port-channels, be cautious with sticky MAC and synchronization between vPC peers. Prefer static secure MACs if you must pin, or simply use a maximum that fits your use case.
I hope this has been helpful!
Laz