Category: CCNA Study Guide
Command Switchport Port-Security Use Enables port security on an interface and sets default actions. The defaults are: max mac address is 1 and the violate action is shutdown the port. Syntax Switch(config-if)#switchport port-security Example In this example, port security is configured for int fa0/2 on SW3. Note that, …
Command Spanning-Tree Port-Priority Use Sets the switches preference for the alternate paths to use if a loop is detected. Syntax Switch(config)#spanning-tree port-priority <number> Example In the below example we will configure SW2 to prefer to use Fa0/24 if a loop is detected in the network. SW2(config)#do show spanning vlan …
Command Switchport Trunk Encapsulation dot1q Use Enables dot1q trunking encapsulation on the interface. Syntax Switch(config-if)#switchport trunk encapsulation dot1q Example First, here is the trunking information for SW3. Note fa0/19, which is set to ISL. SW3(config-if)#do show int trunkPort Mode Encapsulation Status Native vlan Fa0/19 auto isl trunking 1 …
Command Switchport Mode Trunk Use Enables trunking on an interface. Before enabling trunking, encapsulation needs to be set using the switchport trunk encapsulation command. Syntax Switch(config-if)#switchport mode trunk Example In this example, trunking is enabled on fa0/2. Before enabling trunking, encapsulation is also set. SW3#conf t Enter configuration commands, one …
Command Spanning-Tree Portfast Use This command essentially disables spanning-tree on an interface and brings it immediately into the forwarding state. Only use this command on access ports Syntax Switch(config-if)#spanning-tree portfast Example In the below example we will configure SW1’s Fa0/2 to use port-fast to immediately skip to the …
Command Spanning-Tree Cost Use This command modifies the interface cost used in calculating the root port for spanning-tree on a switch. Lower is better. Syntax Switch(config-if)#spanning-tree cost <cost> Example In the below example we will configure SW2 to use Fa0/24 as the root port for all VLANs. SW2(config)#do …
Command Spanning-Tree Vlan Port-Priority Use If a loop occurs, spanning tree uses the port priority when selecting an interface to put into the forwarding state. Lower is better Syntax Switch(config-if)#spanning-tree vlan <vlan range> port-priority <priority> Example In the below example we will configure SW2 to prefer to use …
Command Switchport Access Vlan Use Sets the VLAN that the interface belongs to. Syntax Switch(config-if)#switchport access vlan <vlan # > Example In this example, port fa0/2 on SW3 is set to VLAN 10. Here is the VLAN information on SW3 before the changes. Notice that all interfaces belong …
Command Switchport Trunk Native Vlan Use Changes the native VLAN for dot1q encapsulation. Syntax Switch(config-if)#switchport trunk native vlan <vlan #> Example In this example, the native VLAN for int fa0/2 is changed. SW#conf t SW#int fa0/2 SW3(config-if)#switchport trunk native vlan 55 Here’s the trunking information for SW3. SW3(config-if)#do show …
Command Spanning-Tree Vlan Cost Use This command modifies the interface cost used in calculating the root port for spanning-tree on a switch for a specified vlan range. Lower is better. Syntax Switch(config-if)#spanning-tree vlan <vlan range> cost <cost> Example In the below example we will configure SW2 to use …