How to Configure Multiple VLANs on a Port

Save

A port must be configured for use before a device can be connected. There are two modes that a port can be configured for to carry a Virtual Local Area Network. Trunk mode or access mode are the two modes that can be configured depending on what type of device the port will be connected to. Trunk ports are used to connect other network backbone devices like switches or routers. Access ports are used to connect hosts like servers, computer workstations or Internet Protocol phones.

Configure Access Port

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

  • Enter configuration mode by typing "configuration terminal".

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

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

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

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

  • Turn the port on by typing "no shutdown".

  • Exit configuration mode by typing "end". Save your changes by typing "write memory".

Configure Trunk Port

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

  • Enter configuration mode by typing "configuration terminal".

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

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

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

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

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

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

  • Turn the port on by typing "no shutdown".

  • Exit configuration mode by typing "end" and save your changes by typing "write memory".

References

  • "CCNA Self-Study: Interconnecting Cisco Network Devices (ICND) 640-811, 640-801, 2nd Edition"; Stephen McQuerry; 2003
  • “CCNA: Cisco Certified Network Associate Fast Pass, Third Edition”; Todd Lammle; 2008
  • “Cisco CCNA/CCENT Exam 640-802, 640-822, 640-816 Preparation Kit”; Dale Liu; 2009
  • “Designing for Cisco Internetwork Solutions (DESGN) (Authorized CCDA Self-Study Guide) (Exam 640-863), Second Edition”; Diane Teare; 2008
  • Photo Credit Hemera Technologies/AbleStock.com/Getty Images
Promoted By Zergnet

Comments

Resources

You May Also Like

Related Searches

Check It Out

Geek Vs Geek: Robot battles, hoverboard drag race, and more

M
Is DIY in your DNA? Become part of our maker community.
Submit Your Work!