How to Enable PortFast on Cisco Switch in GNS3

When configuring the Spanning Tree Protocol on redundant networks, you must always configure the interfaces of the Servers or the network printers that connected to the Switch, as PortFast (PF).

How to Enable PortFast on Cisco Switch in GNS3

How to Configure PortFast on Layer 2 Switch with GNS3

PortFast configuration is very important when configuring the Spanning Tree Protocol. You need to identify the Switch interfaces that it does not undergo STP Convergence operation as a result of a port or connection failure in redundant networks.

For example, a Hosting Server that needs to provide continuous service in a corporate company should not lose 1-minute connection. If Cisco Switches used in the network environment, the interface to which this Server connected must be set directly to Forwarding mode, excluding STP Convergence.

In the above example, if PortFast not configured, the server will time out for 50 seconds. This will be unacceptable for the firm’s customers.

In our previous article, we reviewed the Examining STP and Root Bridge Configuration. In this article, we will enable PortFast on the interfaces to which computers of great importance are connected.

How to Setup Port Fast

To enable Port Fast on L2 Switches in a small network using GNS3, follow the steps below.

   Step 1

Open the GNS3 simulator and create a new project.

Creating a New Project in GNS3

   Step 2

If you haven’t added L2 Switch to GNS3 before, you can check our article Adding L2 Switch. After adding L2 Switch, create a network topology as shown in the image below.

Creating a GNS3 Network Topology

   Step 3

The following network topology uses VPCS computers. Open the CLI command prompt of the VPCS computers and configure the TCP/IP configuration.

Then, test the connection by pinging from the Lenovo PC to the HP PC. Add -t to the end of the command to continuously ping.

Continuous Pinging

   Step 4

Unplug the cable connected to the L2-SW-1 GigabitEthernet 0/2 interface when pinging continuously from the Lenovo PC to the HP PC. And then go back to the CLI command prompt to check Ping.

Disconnecting the Network Cable Between the Switch and the Computer

   Step 5

Naturally, the Ping operation between VPCS computers failed. Now reconnect the HP PC to the SW1 and check the status in the next step.

Ping Timeout Error

   Step 6

When the HP PC reconnected, the SW1 Gig0/2 interface did not switch directly to Forwarding Mode, as seen in Ping. So the downtime will be 50 seconds.

To prevent this, you must enable PortFast on the Switches. And as a result of this operation, 50 seconds downtime will be 1 second!

Ping Downtime

   Step 7

Open the SW1 CLI command prompt and activate PortFast on the interface to which the HP PC connected to SW1.

SW1# conf t
SW1(config)# interface gigabitethernet 0/2
SW1(config-if)# spanning-tree portfast
SW1(config-if)# end

 
SW1(config-if)# spanning-tree portfast

   Step 8

Start Pinging from Lenovo PC to HP PC again.

Continuous Pinging

   Step 9

Similarly, terminate the SW1 connection to the HP PC again.

Disconnecting the Network Cable

   Step 10

Ping Timeout time started as soon as the cable was disconnected.

Ping Error

   Step 11

When you reconnect to the HP PC and SW1, the Ping Timeout time will not be the same as before the PortFast configuration. And as a result, it will immediately enter Forwarding mode.

Forwarding Mode

   Step 12

When you check Ping from Lenovo PC to HP PC, you may notice that Ping will delay by 1 second.

Ping Successful

   Step 13

On the Cisco Switch SW1 privileged mode, execute the show spanning-tree command. You can see that the SW1 GigabitEthernet 0/2 interface is Edge.

show spanning-tree

   Step 14

When you run the show running-config command on SW1, you can see that only PortFast enabled on the GigabitEthernet 0/2 interface.

show running-config

Show Commands


SW1#show spanning-tree

VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 005e.5706.1000
Cost 4
Port 2 (GigabitEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 005e.5773.a200
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec

Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi0/0 Altn BLK 4 128.1 Shr
Gi0/1 Root FWD 4 128.2 Shr
Gi0/2 Desg FWD 4 128.3 Shr Edge
Gi0/3 Desg FWD 4 128.4 Shr

SW1#

 


SW1#show spanning-tree detail

VLAN0001 is executing the ieee compatible Spanning Tree protocol
Bridge Identifier has priority 32768, sysid 1, address 005e.5773.a200
Configured hello time 2, max age 20, forward delay 15
Current root has priority 32769, address 005e.5706.1000
Root port is 2 (GigabitEthernet0/1), cost of root path is 4
Topology change flag not set, detected flag not set
Number of topology changes 2 last change occurred 00:08:40 ago
from GigabitEthernet0/2
Times: hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 15
Timers: hello 0, topology change 0, notification 0, aging 300

Port 1 (GigabitEthernet0/0) of VLAN0001 is alternate blocking
Port path cost 4, Port priority 128, Port Identifier 128.1.
Designated root has priority 32769, address 005e.5706.1000
Designated bridge has priority 32769, address 005e.570d.0b00
Designated port id is 128.1, designated path cost 4
Timers: message age 2, forward delay 0, hold 0
Number of transitions to forwarding state: 0
Link type is shared by default
BPDU: sent 1, received 277

Port 2 (GigabitEthernet0/1) of VLAN0001 is root forwarding
Port path cost 4, Port priority 128, Port Identifier 128.2.
Designated root has priority 32769, address 005e.5706.1000
Designated bridge has priority 32769, address 005e.5706.1000
Designated port id is 128.2, designated path cost 0
Timers: message age 1, forward delay 0, hold 0
Number of transitions to forwarding state: 1
Link type is shared by default
BPDU: sent 3, received 276

Port 3 (GigabitEthernet0/2) of VLAN0001 is designated forwarding
Port path cost 4, Port priority 128, Port Identifier 128.3.
Designated root has priority 32769, address 005e.5706.1000
Designated bridge has priority 32769, address 005e.5773.a200
Designated port id is 128.3, designated path cost 4
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
The port is in the PF mode
Link type is shared by default
BPDU: sent 276, received 0

Port 4 (GigabitEthernet0/3) of VLAN0001 is designated forwarding
Port path cost 4, Port priority 128, Port Identifier 128.4.
Designated root has priority 32769, address 005e.5706.1000
Designated bridge has priority 32769, address 005e.5773.a200
Designated port id is 128.4, designated path cost 4
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
Link type is shared by default
BPDU: sent 276, received 0

SW1#

 


SW1#show running-config
Building configuration...

Current configuration : 4751 bytes
!
! Last configuration change at 03:47:28 UTC Sat Sep 9 2017
!
version 15.0
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname SW1
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
!
!
ip cef
no ipv6 cef
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
!
interface GigabitEthernet0/0
media-type rj45
negotiation auto
!
interface GigabitEthernet0/1
media-type rj45
negotiation auto
!
interface GigabitEthernet0/2
media-type rj45
negotiation auto
spanning-tree PF
!
interface GigabitEthernet0/3
media-type rj45
negotiation auto
!
ip forward-protocol nd
!
no ip http server
no ip http secure-server
!
!
control-plane
!
line con 0
line aux 0
line vty 0 4
!
!
end

SW1#

 

How to Configure Port Fast ⇒ Video

Watch the video below for configuring PortFast and also subscribe to our YouTube channel to support us!

   Final Word


Port Fast is a feature of Cisco Switches and not used in other brands. Configuring Port Fast means that the connection on the network is continuous. You can also implement the Spanning Tree PortFast configuration in Cisco Packet Tracer, but it does not support the UplinkFast and BackboneFast features. Thanks for following us!

   Related Articles


How Switch Learns MAC Addresses
How to Configure Loopback Adapter
How to Configure OSPF
How to Configure EIGRP
How to Configure RIP

Add a Comment

Your email address will not be published. Required fields are marked *

shares
error: