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 gi1/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 gi1/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.
Disclaimer: The views expressed and the content shared are those of the author and do not reflect the views of the author’s employer or techbeatly platform.
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Leave a Reply