For ports on which the port security function is enabled, you can pre-register the MAC address of a terminal for which you want to permit communication, thereby allowing communication only for permitted terminals.
Conversely, if there is access from a terminal that is not registered (an illegal terminal), this is considered illegal access, and the packets are discarded.
Depending on the settings, the corresponding port can also be shut down.
The port security function cannot be used simultaneously with the port authentication function.
Simply by enabling the port security function, and using the port-security mac-address command to register the MAC addresses of the terminals for which you want to permit communication, you can limit the terminals that are permitted access.