Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

SWITCHING

To configure the IP address assigned to the management interface on VLAN 1, enter global
configuration mode.

Switch>enable

Switch#configure terminal

Next, enter the interface configuration mode for VLAN 1.

Switch(config)#interface vlan 1

Set the IP address, subnet mask, and default gateway for the management interface. The IP address
must be valid for the local network where the switch is installed.

Switch(config-if)#ip address 192.168.1.2 255.255.255.0

Switch(config-if)#exit

Switch(config)#ip default-gateway 192.168.1.1

Switch(config)#end

Save the configuration by using the copy running-configuration startup-configuration command.

Port security

Static
S1#conf t
S1(config)#int fa0/1
S1(config-if)#switchport mode access
S1(config-if)#switchport port -security <mac address>
S1(config-if)#end

Dynamic
S1#conf t
S1(config)#int fa0/1
S1(config-if)#switchport mode access
S1(config-if)#switchport port -security
S1(config-if)#end

Sticky
S1#conf t
S1(config)#int fa0/1
S1(config-if)#switchport mode access
S1(config-if)#switchport port -security
S1(config-if)#switchport port -security maximum 50
S1(config-if)#switchport port -security mac-address sticky
S1(config-if)#end

To verify port security settings for the switch or the specified interface, use the show port-security
interface <interface-id> command.

Use the clear port-security sticky interface <port#> access to clear any learned addresses. Next,
shutdown the port using the shutdown command. Finally, re-enable the port using the no shutdown
command.

Disable port security using the no switchport port-security interface command.

encrypt passwords with the service password-encryption

The output from the show cdp neighbors and show cdp neighbors detail commands displays the
information that a Cisco device collects from its directly connected neighbors

To disable CDP globally use


R3(config)#no cdp running-configuration

To disable CDP on inly an interface


R3(config-if)#no cdp enable

If CDP is globally disabled>To enable again


Router(config)#cdp run
Router(config-if)#cdp enable

You might also like