Switchport Mode Trunk Command on CISCO Router/Switch

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 …

Spanning-Tree Portfast Command on CISCO Router/Switch

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 …

Spanning-Tree Cost Command on CISCO Router/Switch

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 …

Switchport Trunk Native Vlan Command on CISCO Router/Switch

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 …

Spanning-Tree Vlan Cost Command on CISCO Router/Switch

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 …

Switchport Mode Access Command on CISCO Router/Switch

Command Switchport Mode Access Use Sets interface to access mode. Syntax Switch(config-if)#switchport mode access Example In this example int fa0/2 is set to access mode on SW4. SW2#conf t Enter configuration commands, one per line. End with CNTL/Z. SW2(config)#int fa0/2 SW2(config-if)#switchport mode access

IP Default-Gateway Command on CISCO Router/Switch

Command IP Default-Gateway Use Provides a default-gateway for the switch to send all unknown IP packets. Allows proper communication between switches and routers. Syntax Switch(config)#ip default-gateway <ip address> Example In the below example we will configure SW1 to use a default-gateway to ping R1’s loopback0. First, we will …