How to Configure Multiple VLANs on a Port

: Configure Access Port

Step 1 – Open a telnet program such as Putty or Command Prompt on your computer. Using Windows 7, click the Windows icon in the lower-left corner. Type "cmd" into the search field and press "Enter." This will open the command prompt. To access the switch you will be working on type "telnet x.x.x.x", where x.x.x.x is the IP address of your device. You should be presented with the name of your device followed by a pound sign and a blinking cursor. The blinking cursor is the notification that your device is waiting for further commands.

Step 2 – Enter configuration mode by typing "configuration terminal".

Step 3 – Access the port to be configured by typing "interface G0/1". "G0/1" can be edited to include any port on the switch.

Step 4 – Apply the access-mode command to allow the interface to become strictly an access port by typing "switchport mode access".  This mode is recommended if you are connecting hosts or if this is an open port for security reasons.

Step 5 – Attach the VLAN to the interface by typing "switchport access vlan 10". "vlan 10" can be edited to include any VLAN number.  If the VLAN has not been previously created or used, the switch will take a moment to create the VLAN for the first time.

Step 6 – Add a second VLAN for voice to the interface by typing "switchport voice vlan 20".   "vlan 20" can be changed to any VLAN number.

Step 7 – Turn the port on by typing "no shutdown".

Step 8 – Exit configuration mode by typing "end". Save your changes by typing "write memory".

Configure Trunk Port

Step 1 – Open a telnet program such as Putty or Command Prompt on your computer. Using Windows 7, click the Windows icon in the lower-left corner. Type "cmd" into the search field and press "Enter." This will open the command prompt. To access the switch you will be working on type "telnet x.x.x.x", where x.x.x.x is the IP address of your device. You should be presented with the name of your device followed by a pound sign and a blinking cursor. The blinking cursor is the notification that your device is waiting for further commands.

Step 2 – Enter configuration mode by typing "configuration terminal".

Step 3 – Access the port to be configured by typing "interface G0/1". "G0/1" can be edited to include any port on the switch.

Step 4 – Configure the encapsulation type for the trunk by typing "switchport trunk encapsulation negotiate".  There are three settings; "isl," "dot1q" or "negotiate."  "Negotiate" will allow the interface to find out what the other device on the other side of the cable is set to without negotiation issues and the link will come up.  Use one of the other two options if you know what the setting should be and want to secure the port to never choose the other type.

Step 5 – Apply the trunk mode command to allow the interface to become strictly a trunk port by typing "switchport mode trunk".  This creates a tunnel or pipe to the other switch to allow one or many VLANs across.

Step 6 – Allow the VLANs over the trunk by typing "switchport trunk allowed vlan 10, 20". This list of VLANs can use commas to separate numbers (10, 20), a dash to include a range of ports (10-20) or both commas and dashes to include many VLANS (10, 12-15, 20). Edit the VLAN numbers to include the VLANs you are adding.

Step 7 – Add more VLANs to the port if necessary. If you forget a number, you can go back and add it by typing "switchport trunk allowed vlan add 14".  The "add" command is mandatory; if you do not include the word "add," every other VLAN on the port will be deleted.

Step 8 – Remove VLANs from the port if necessary.  To remove a VLAN, type "switchport trunk allowed delete 14".  All of these VLAN numbers can be replaced with the VLAN number you are removing.

Step 9 – Turn the port on by typing "no shutdown".

Step 10 – Exit configuration mode by typing "end" and save your changes by typing "write memory".

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.