Get up to 50% off on CKA, CKAD, CKS, KCNA, KCSA exams and courses!

Configure or Change Interface (access mode) VLAN on Cisco IOS

Configure or Change Interface (access mode) VLAN on Cisco IOS
Image : www.unifore.net
This is simple and straight forward. Below snippets are from a Cisco 3120X Blade Switch.

Check the interface details on port Gi1/0/1.

ams-101-sw1>en
ams-101-sw1#sh run | begin interface GigabitEthernet1/0/1
interface GigabitEthernet1/0/1
 switchport access vlan
401
 switchport mode access
 link state group 1 downstream
 spanning-tree portfast
!

Okay, the port is configured with VLAN 401 right now. Let’s change it to VLAN 402. (Below command will change ports 1)

ams-101-sw1#conf t
ams-101-sw1(config)#int gi
1/0/1
ams-101-sw1(config-if)#switchport access vlan
402
ams-101-sw1(config-if)#no sh
ams-101-sw1(config-if)#
exit

But if you want to configure it to multiple ports, you can use below command (this command will add ports 2-13 to VLAN 402)

ams-101-sw1#conf t
ams-101-sw1(config)#int range gi
1/0/2-13
ams-101-sw1(config-if-range)#switchport access vlan
402
ams-101-sw1(config-if-range)#no sh
ams-101-sw1(config-if-range)#
exit

Now let’s verify the VLAN 402 members.

ams-101-sw1#sh vlan | include 402
VLAN Name         Status    Ports
407  Linux_Server active    Gi1/0/1, Gi1/0/2, Gi1/0/3, Gi1/0/4, Gi1/0/5,Gi1/0/6, Gi1/0/7, Gi1/0/8, Gi1/0/9, Gi1/0/10, Gi1/0/11, Gi1/0/12, Gi1/0/13, Po1

Check the running config for a specific interface (in this case we check Gi1/0/2).

ams-101-sw1#sh run | beg interface GigabitEthernet1/0/2
interface GigabitEthernet1/0/2
 switchport access vlan
402
 switchport mode access
 link state group 1 downstream
 spanning-tree portfas

And don’t forget to save your configuration.

ams-101-sw1#copy running-config startup-config

That’s it.

Herry Purnama

Herry Purnama

Technical Project Lead at T-Systems Malaysia


Note

Disclaimer: The views expressed and the content shared in all published articles on this website are solely those of the respective authors, and they do not necessarily reflect the views of the author’s employer or the techbeatly platform. We strive to ensure the accuracy and validity of the content published on our website. However, we cannot guarantee the absolute correctness or completeness of the information provided. It is the responsibility of the readers and users of this website to verify the accuracy and appropriateness of any information or opinions expressed within the articles. If you come across any content that you believe to be incorrect or invalid, please contact us immediately so that we can address the issue promptly.

Share :

Related Posts

How to find the pod details from container in OpenShift

When we have issue with container and we are not sure which pod the container belongs to; we can find the pods details as below.

Subnet Mask Information – Quick Reference Sheet

AddressBitsPrefNetMask1 0/32255.255.255.2552 1/31255.255.255.2544 2/30255.255.255.2528 3/29255.255.255.24816 4/28255.255.255.24032 …

How To Create A New User In iDRAC Via Local RACADM From Linux

How To Create A New User In iDRAC Via Local RACADM From Linux

There might be situations like you forgot or lost your iDRAC login credentials and you don’t have an option to access iDRAC since the server is in a …