Cisco Switch – How to Remove Switchport Mode Access

ciscocisco-iosswitch

This is in Cisco Packet Tracer – this is not a real switch.

Default interface config on Cisco Switch 2960 looks like this

!
interface FastEthernet0/10
!

Then I put it in switchport mode access

!
interface FastEthernet0/10
 switchport mode access
!

However, when I tried to remove it with no switchport mode access, I was getting the following error.

Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int f0/10
Switch(config-if)#no switchport mode access
Command rejected: An interface must be configured to the Access or Trunk    modes to be configured to NoNegotiate.
Switch(config-if)#

I've also tried default interface f0/10 but didn't work

Switch(config)#default interface f0/10
Building configuration...
Command rejected: An interface must be configured to the Access or Trunk    modes to be configured to NoNegotiate.
   
Interface FastEthernet0/10 set to default configuration
Switch(config)#
Switch(config)#do sh run
...
!
interface FastEthernet0/10
 switchport mode access
!
...

What is the right way to remove switchport mode access from the config?

Best Answer

By right, you should be able to remove it with no switchport mode access.

However, when I test similar config on Packet Tracer, I'm getting exactly similar error message.

Are you using the actual switch (hardware) or Packet Tracer?

Anyway, here is how I solved it in Packet Tracer.

Before

Switch(config)#do sh run

!
interface FastEthernet0/1
!

Replicate issue

Switch(config)#int f0/1
Switch(config-if)#switchport mode access

Switch(config-if)#do sh run

!
interface FastEthernet0/1
 switchport mode access
!

Exactly similar issue!

Switch(config-if)#int f0/1
Switch(config-if)#no switchport mode access
Command rejected: An interface must be configured to the Access or Trunk    modes to be configured to NoNegotiate.
Switch(config-if)#

Solution in CPT

Switch(config-if)#no switchport nonegotiate 
Switch(config-if)#no switchport mode access
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Switch(config-if)#

Verify it

Switch(config-if)#do sh run

!
interface FastEthernet0/1
!