4

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?

0
3

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
!
2
  • It is Packet Tracer. He posted this question on Reddit and someone answered it there after guessing it was Packet Tracer. I just edited the post to add that piece of text that would have made this a little easier. – Jesse P. Nov 11 '20 at 13:29
  • Even if it does not actually say it is access, that is the default for the interface, so it will still be an access interface, A layer-2 interface must be access or trunk. You just found a bug to not show it. Not seeing it makes no difference, except to fool rookies because it is still an access interface. – Ron Maupin Nov 11 '20 at 14:59
5

The default of a layer-2 switch interface on that switch model is switchport mode access. The interface is either an access or trunk interface, so you could use the switchport mode trunk to change the mode from access.

You can change it to a routed interface if you have enabled routing with the global ip routing command that allows you to use the interface no switchport command (no mode access or anything else on the command). That changes the interface from a layer-2 to a layer-3 interface, so access or trunk do not apply. You can then apply an ip address to the interface.

To convert back from a layer-3 to a layer-2 interface, you use the switchport interface command (nothing else on the command).

2
  • Thanks @Ron, I did try that but also getting similar error Switch(config-if)#no switchport mode trunk Command rejected: An interface must be configured to the Access or Trunk modes to be configured to NoNegotiate. Switch(config-if)# – Wolf Nov 11 '20 at 12:16
  • 1
    As it says, and what I told you, it is either access or trunk for a layer-2 interface. If you want to disable that, you need to convert it to a layer-3 interface, but if it is a layer-2 interface, it must either be an access interface (default) or a trunk interface. – Ron Maupin Nov 11 '20 at 14:53
2

Go back to the config prompt and type default interface fa0/10 to reset the interface back its default configuration.

2
  • Thanks @Jesse P., but that didn't work too. I've updated my post – Wolf Nov 11 '20 at 1:23
  • @Wolf Interesting. I can't say I've ever noticed that on a 2960, personally. Can I ask why you don't want to leave it in access mode? – Jesse P. Nov 11 '20 at 3:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.