Feb 3, 2011

Change the VLAN of a port on a Cisco Switch

Recently I had to hook up a new network printer in our organization. To do this i had to configure the port on the switch to be on our printer VLAN. I decided this could be useful to something trying to accomplish something similar. For this I will assume that you know the IP address of your Cisco switch.

To change the VLAN of a particular port on your switch:

Open a command prompt
The fastest way to do this is to hit the "Windows Key + R" ( this will open up your "Run" prompt) and type "CMD". Hit Enter.

At your command prompt, telnet into the switch: C:\telnet ***.***.***.*** (replace with your switch's IP address)

If your switch is secured, which it should be, it will prompt you for a password. The Cisco default password is "cisco".

Once you have logged in successfully, it will give you your cisco prompt. Type "enable" and hit enter. This will give you heightened priviledges in the switch.

Once you access enabled mode, You will get the same prompt as before followed by a "#".

To view a quick overview of all the ports on the switch, type "Show Run". This will give you the ports on the switch, what VLAN they are currently on and some other information that you can look into if you are feeling ambitious.

So lets say the port your device is connected to is Port 24. To work with just this specific port, type in "Show run int fastethernet0/24. ( You may have to use "gigabitethernet" instead of "fastethernet". you can find which to use when looking at the ports that the command "Show Run" gives you)

Now that you have it narrowed down to Port 24, you can enter configuration mode to alter the port.

Type "Config t" at your command prompt, this will allow you to configure the port.

You can now enter these configuration commands, one per line.

- int gigabitethernet0/10
- switchport access vlan # ( substitute the # sign for the VLAN # you want your port to be added to)
- switchport mode access <-- use this command if the port isn't already in access mode
- spanning-tree portfast <-- use this command if the port is going to be connected to a pc
( In my case, I was setting up a printer so I did not use the spanning-tree portfast command since it is not a PC)

- end

- write mem
Building configuration...
[OK]

- exit


Congratulations! You have now added your port to the new VLAN and your terminal has brought you back to your windows command prompt. You may exit out of this now if you wish. Test that your device is working properly and relax.


If you have any questions feel free to shoot me an email or send it in a comment to this post. I would be happy to answer any questions I can. Then again, so would Google :)
Share This
Subscribe Here

0 comments:

Post a Comment

 

Site Info

Random Temporary text until I put something meaningful here.

Followers

Error 298 Copyright © 2009 BeMagazine Blogger Template is Designed by Blogger Template
In Collaboration with fifa