cisco remove vlan add vlan

Hello,

i have an sf-300 cisco and i want to remove all vlans assigned to specific port and add the vlan i want.Can someone help me with commands in cli.Thanks.
Mark SoultchAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jody LemoineNetwork ArchitectCommented:
If you only need one VLAN, you can do the following:

interface FastEthernet1
 switchport trunk allowed vlan remove all
 switchport mode access
 switchport access vlan x
 no macro auto smartport

Replace "x" with whatever VLAN you wish to assign to the port.

If you need more than one, you can do this:

interface FastEthernet1
 switchport mode trunk
 switchport trunk allowed vlan remove all
 switchport trunk allowed vlan add x,y,z
 switchport trunk native vlan x (Optional)
 no macro auto smartport

Replace "x", "y" and "z" with whatever VLANs you want on the port. Optionally, if you need the native/untagged VLAN on the trunk to be something other than "1", you can use the "switchport trunk native vlan x" command to change which of the allowed VLANs will be the native/untagged one.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mark SoultchAuthor Commented:
after remove all, i get that message

VLAN 13: Port fa22 cannot be untagged but not Egress.
0
Jody LemoineNetwork ArchitectCommented:
Looks like your native VLAN is set to 13 and the switch doesn't want to remove it. Try doing a "switchport trunk native vlan 1" before removing the VLANs.
0
Don JohnstonInstructorCommented:
switchport trunk allowed vlan x-y

This will define only the VLAN's allowed on a trunk.  You can also have discontinuous VLAN's by using the ","
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Switches / Hubs

From novice to tech pro — start learning today.