Configuring a simple vlan and trunk for 2 switches

Screen Shot 2017-04-20 at 11.44.16 AM.png

  • got 2 switches that i named sw1 and sw2
  • two rename a switch go into global config mode and type switch(config)#hostname sw1
  • after naming the switches we need to create vlans

vlan 1 is the default

valn 2: named it accounts

vlan 4: named it mgt

vlan 6: named it sales

pc3 on sw1 and pc0 on sw2 are part of the accounts vlan. to configure this we do the following




Sw1(config)#vlan 2

sw1(config-vlan)#name accounts


do the same for vlan 4 and 6


after creating vlans, add the ports that the traffic of each vlan is supposed to move in for example pc3 and pc0


sw1(config)#interface fa0/2

sw1(config-int)#switchport access vlan 2

sw1(config-int)#no shutdown


do the same thing for other vlans created above to add ports to them


-if you notice there is a connection between sw1 and sw2. that will be in default vlan 1. We need to create a trunk port that makes vlans from one switch communicate with the other network


enter sw1 global config mode and configure the interface connecting to the other switch


sw1(config)int fa0/1

sw1(config-if)#switchmode access trunk


ping  computers in the same vlan and should get replies..










Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s