Cyber Deals - Get up to 65% 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


Disclaimer: Views expressed in articles are those of the respective authors and do not necessarily reflect the views of their employers or this site. While we aim for accuracy, please verify information before relying on it, and let us know if you spot an error.
Share:

Related Posts

OpenShift Cluster – How to Drain or Evacuate a Node for Maintenance

OpenShift Cluster – How to Drain or Evacuate a Node for Maintenance

As we know OpenShift clusters are bundled with multiple compute nodes, master nodes, infra nodes etc, it’s not a big deal to manage node …

How to install racadm for iDRAC on RHEL / Linux

How to install racadm for iDRAC on RHEL / Linux

Dell has a beautiful tool for remote server management called iDRAC which is almost same like HPE iLO, but with different features. You can access...

ComVault Simpana Installation (cv11) on Linux (RHEL7)- Step by Step

ComVault Simpana Installation (cv11) on Linux (RHEL7)- Step by Step

This is a very basic article to share the cv11 installation. If any corrections/mistakes, please feel free to feedback as I am not an expert...

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...

Infrastructre & hardware

Enable LVM flag on partition using parted in Linux

Recently we have noticed some issue with one of our filesystem having issue and realized wrong flags on partition which was used as a Physical...

Automation

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....