Configuring port lock

Configure port lock to administratively lock a port or ports to prevent other users from changing port parameters or modifying port action. You cannot modify a locked port until you unlock the port.

Procedure

  1. Enter Global Configuration mode:

    enable

    configure terminal

  2. Enable port lock globally:

    portlock enable

  3. Enter GigabitEthernet Interface Configuration mode:

    interface gigabitethernet {slot/port[/sub-port] [-slot/port[/sub-port]] [,...]}

  4. Lock a port:

    lock [port {slot/port[/sub-port] [-slot/port[/sub-port]] [,...]}] enable

Example

Switch:1> enable 
Switch:1# configure terminal 

Log on to GigabitEthernet Interface Configuration mode:

Switch:1(config)# interface GigabitEthernet 1/1 

Lock port 1/1:

Switch:1(config-if)# lock port 1/1 enable 

Unlock port 1/1:

Switch:1(config-if)# no lock port 1/1 enable 

Variable Definitions

The following table defines parameters for the interface gigabitethernet command.

Variable

Value

{slot/port[/sub-port] [-slot/port[/sub-port]] [,...]}

Identifies the slot and port in one of the following formats: a single slot and port (slot/port), a range of slots and ports (slot/port-slot/port), or a series of slots and ports (slot/port,slot/port,slot/port). If the platform supports channelization and the port is channelized, you must also specify the sub-port in the format slot/port/sub-port.

The following table defines parameters for the lock port command.

Variable

Value

{slot/port[/sub-port] [-slot/port[/sub-port]] [,...]}

Specifies the port you want to lock.

Identifies the slot and port in one of the following formats: a single slot and port (slot/port), a range of slots and ports (slot/port-slot/port), or a series of slots and ports (slot/port,slot/port,slot/port). If the platform supports channelization and the port is channelized, you must also specify the sub-port in the format slot/port/sub-port.

The default is disabled.