226Usage guidelinesThe userLogin mode is supported on any Layer Ethernet ports. Other port security modes aresupported only on the following ports:• Layer 2 Ethernet ports on the following modules: HMIM-8GSW. HMIM-24GSW. HMIM-24GSWP. SIC-4GSW.• Fixed Layer 2 Ethernet ports on the following routers: MSR810/810-W/810-W-DB/810-LM/810-W-LM/810-LM-HK/810-W-LM-HK/810-10-PoE/810-LMS/810-LUS. MSR2600-10-X1. MSR3600-28/3600-51. MSR3600-28-SI/3600-51-SI.To change the security mode for a port security enabled port, you must set the port in noRestrictionsmode first. Do not change port security mode when the port has online users.IMPORTANT:If you are configuring the autoLearn mode, first set port security's limit on the number of secure MACaddresses by using the port-security max-mac-count command. You cannot change the settingwhen the port is operating in autoLearn mode.When port security is enabled, you cannot enable 802.1X or MAC authentication, or change theaccess control mode or port authorization state. The port security automatically modifies thesesettings in different security modes.As a best practice, do not enable the mac-else-userlogin-secure ormac-else-userlogin-secure-ext mode on the port where MAC authentication delay is enabled. Thetwo modes are mutually exclusive with the MAC authentication delay feature. For more informationabout MAC authentication delay, see "MAC authentication commands."Examples# Enable port security, and set GigabitEthernet 1/0/1 to operate in secure mode. system-view[Sysname] port-security enable[Sysname] interface gigabitethernet 1/0/1[Sysname-GigabitEthernet1/0/1] port-security port-mode secure# Change the port security mode of GigabitEthernet 1/0/1 to userLogin.[Sysname-GigabitEthernet1/0/1] undo port-security port-mode[Sysname-GigabitEthernet1/0/1] port-security port-mode userloginRelated commandsdisplay port-securityport-security max-mac-countport-security timer autolearn agingUse port-security timer autolearn aging to set the secure MAC aging timer.Use undo port-security timer autolearn aging to restore the default.