{"id":6371,"date":"2026-05-04T12:10:34","date_gmt":"2026-05-04T12:10:34","guid":{"rendered":"http:\/\/docs.connexite.co.uk\/index.php\/docs\/connexite-documentation\/synapse-cli-documentation\/cli-configuring-port-security\/"},"modified":"2026-05-04T12:19:09","modified_gmt":"2026-05-04T12:19:09","slug":"cli-configuring-port-security","status":"publish","type":"docs","link":"https:\/\/docs.connexite.co.uk\/index.php\/docs\/network\/synapse-cli-documentation\/cli-configuring-port-security\/","title":{"rendered":"Configuring Port Security"},"content":{"rendered":"<h2 class=\"connexite-doc-h2\">Overview of Port Security<\/h2>\n<p>You can use port security to block input to a Fast Ethernet, or Gigabit Ethernet port when the MAC address of the station attempting to access the port is different from any of the MAC addresses that are specified for that port. Alternatively, you can use port security to filter traffic that is destined to or received from a specific host that is based on the host MAC address. The maximum number of MAC addresses that you can allocate for each port depends on your network configuration. After you allocate the maximum number of MAC addresses on a port, you can either specify the secure MAC address for the port manually or have the port dynamically configure the MAC address of the connected devices. When a secure port receives a packet, the source MAC address of the packet is compared to the list of secure source addresses that were manually configured or autoconfigured (learned) on the port. If a MAC address of a device that is attached to the port differs from the list of secure addresses, A violation occurs. Users can set a port to the following two modes to handle a security violation: Restrict: Drops all packets from insecure hosts, but remains enabled, until the MAC of the host aged out dynamic. You can manually shutdown and no-shutdown the interface to recover from violation. Shutdown: The shutdown mode option allows you to specify whether the port is to be permanently disabled or disabled for only a specified time. The default is for the port to shut down permanently. You can manually shutdown and no-shutdown the interface to recover from violation. If you want to convert dynamic security users to static security users, you can enable the sticky function on the port. If the sticky function is enabled, the dynamic users learned on the port will exist as static users. If the configuration is saved, it will still exist after the device restarts.<\/p>\n<h2 class=\"connexite-doc-h2\">Note<\/h2>\n<ul class=\"connexite-doc-list\">\n<li>Only support L2 port for port security, such as physical port and L2 AP port.<\/li>\n<li>Only supports configuring port security function in access mode.<\/li>\n<li>Do not support AP member port configuration port security function.<\/li>\n<li>The destination port of the SPAN does not support the port security function.<\/li>\n<li>Does not support the port security function on ports that have been configured with static MAC addresses.<\/li>\n<\/ul>\n<h2 class=\"connexite-doc-h2\">Configuring<\/h2>\n<ul class=\"connexite-doc-list\">\n<li>Enable Port Security<\/li>\n<\/ul>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)#switchport port-security<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)#no switchport port-security<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">Enable Port Security on the interface.<\/p>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)#switchport port-security maximum VALUE<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)#no switchport port-security maximum<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">The default maximum number of secure addresses is 1 VALUE range from 1 to 1024.<\/p>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)#switchport port-security mac-address MAC_ADDR<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)#no switchport port-security mac-address MAC_ADDR<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">Enters a secure MAC address for the interface. If you configure fewer secure MAC addresses than the maximum, the remaining MAC addresses will be dynamically learned.<\/p>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)# switchport port-security mac-address sticky<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)#no switchport port-security mac-address sticky<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">Enable sticky learning on the interface.<\/p>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)#switchport port-security aging time MINUTES<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)#no switchport port-security aging time<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">Sets the aging time for the secure port. Valid range for aging_time is from 0 to 1440 minutes. If the time is equal to 0, aging is disabled for this port.<\/p>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)# switchport port-security aging static<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)#no switchport port-security aging static<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">enables aging for statically configured secure addresses on this port.<\/p>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)# switchport port-security violation { strict | shutdown }<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)#no switchport port-security violation<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">Sets the violation mode, the action to be taken when a security violation is detected, as one of these: Restrict: A port security violation restricts data and causes the SecurityViolation counter to increment and send an SNMP trap notification. Shutdown: The interface is error-disabled when a security violation occurs. You can manually reenable the by entering the shutdown and no shut down commands. When a secure port is in the error-disabled state, it will recover after errdisable recovery time.<\/p>\n<h2 class=\"connexite-doc-h2\">Examples<\/h2>\n<p>Example 1\uff1aThis is an example of Port Security typical application. Port Security is enabled on the interface gigabitEthernet0\/1, the MAX secure Mac-address of the interface gigabitEthernet0\/1 is 3, and we enter 3 secure Mac-address on the interface. When the interface gigabitEthernet0\/1 receives a packet, If the SRC MAC-address of the packet differs from the list of secure Mac-addresses, the packet will be dropped.<\/p>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)#switchport port-security<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)#switchport port-security maximum 3<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)#switchport port-security mac-address 0001.0001.0001<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)#switchport port-security mac-address 0001.0001.0002<\/code><\/pre>\n<pre class=\"connexite-doc-command\"><code>SWITCH(config-if)#switchport port-security mac-address 0001.0001.0003<\/code><\/pre>\n<h2 class=\"connexite-doc-h2\">Display Information<\/h2>\n<ul class=\"connexite-doc-list\">\n<li>Display Interfaces Port Security Brief<\/li>\n<\/ul>\n<pre class=\"connexite-doc-command\"><code>SWITCH#show port-security brief<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">interface mac-address mac-address violation violation maxinum count count action &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- GiE0\/1 10 3 0 shutdown GiE0\/2 1 0 0 restrict GiE0\/3 1 0 0 restrict GiE0\/4 1 0 0 restrict GiE0\/5 1 0 0 restrict GiE0\/6 1 0 0 restrict GiE0\/7 1 0 0 restrict GiE0\/8 1 0 0 restrict<\/p>\n<pre class=\"connexite-doc-command\"><code>SWITCH#show port-security interface gigabitEthernet0\/1<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">Port Security : Enabled Maimum MAC Addresses : 10 Violation Mode : Shutdown Aging Time(mins) : 10 Aging static : Enabled Total MAC Addresses : 3 Configured MAC Addresses : 2 Security Violation Count : 0 Last Violate Address : &#8212;<\/p>\n<pre class=\"connexite-doc-command\"><code>SWITCH#show port-security Mac-address<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">interface vlan mac-address type left-time(min) &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; GiE0\/1 1 0001.0002.0004 static 10 GiE0\/1 1 0001.0002.0003 static 10 GiE0\/1 1 000e.c6c1.3a03 dynamic 10<\/p>\n<pre class=\"connexite-doc-command\"><code>SWITCH#show port-security mac-address interface gigabitEthernet0\/1<\/code><\/pre>\n<p class=\"connexite-doc-command-desc\">interface vlan mac-address type left-time(min) &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; GiE0\/1 1 0001.0002.0004 static 10 GiE0\/1 1 0001.0002.0003 static 10 GiE0\/1 1 000e.c6c1.3a03 dynamic 10<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Networking \u203a Switching \u203a Edge \u203a Synapse<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":6349,"menu_order":22,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[115,119,116],"class_list":["post-6371","docs","type-docs","status-publish","hentry","doc_tag-connexite","doc_tag-network","doc_tag-synapse-cli-documentation","no-post-thumbnail"],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/docs\/6371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=6371"}],"version-history":[{"count":1,"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/docs\/6371\/revisions"}],"predecessor-version":[{"id":6419,"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/docs\/6371\/revisions\/6419"}],"up":[{"embeddable":true,"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/docs\/6349"}],"wp:attachment":[{"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=6371"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/docs.connexite.co.uk\/index.php\/wp-json\/wp\/v2\/doc_tag?post=6371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}