Change switchport mode automatically?

Answered Question
Oct 10th, 2007
User Badges:

How do I configure a CAT2900 switch port to automatically change between access mode and trunk mode by detecting the client plugged into it?


Normally the port will stay in trunk mode. My client wants to utilize the same switch port to install/access servers when needed. In that case, the switch port needs to be reconfigured to access mode. Is there a way to have the switch port change its mode adaptive to the client automatically?

Correct Answer by lgijssel about 9 years 5 months ago

You come up with more questions than I can answer by head! ;-)

Here's some reading on the subject, I believe you will find the answers in there:

http://www.cisco.com/en/US/docs/switches/lan/catalyst6500/ios/12.2SXF/native/configuration/guide/layer2.html


Leo

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4 (1 ratings)
Loading.
lgijssel Wed, 10/10/2007 - 10:59
User Badges:
  • Red, 2250 points or more

Is your switch a 2900XL or do you mean a 2950?

If your software supports it, you may also use "switchport mode dynamic". You will have to test it.

I cannot confirm that a 2900 is capable of this.


regards,

Leo

jackawang Wed, 10/10/2007 - 11:08
User Badges:

2950. It is a pretty new one.

Once done "switchport mode dynamic", how does the switchport know

In access mode:

Which VLAN to forward if I have multiple VLANS configured?


In trunk mode:

How do I have it trunk selected VLANS instead of all?

lgijssel Wed, 10/10/2007 - 11:19
User Badges:
  • Red, 2250 points or more

You will configure that using: "switchport access vlan xx", defaults to vlan1.

In trunk mode: How do I have it trunk selected VLANS instead of all?

You can configure that using: "switchport trunk allowed vlan "


Another useful command to see what is happening: "sh int fa0/.xx switchport"

This will give you all info on the subject.


regards,

Leo

jackawang Wed, 10/10/2007 - 11:33
User Badges:

Here is the configuration I made:


interface GigabitEthernet0/1

switchport access vlan 10

switchport trunk allowed vlan 2-5,10

switchport mode dynamic auto

!


I'll need to verify if it works as expected. In what case should I use "switchport mode dynamic desirable"?

Actions

This Discussion