VLAN to VLAN Access in Trunk Mode

In this article I describe the VLAN to VLAN access in trunk mode. VLAN provides multiple virtual networks in a physical network. We can break a local area network into multiple virtual networks. The devices of same virtual network can communicate with each other without interfere to other virtual network. The switchports of a switch can be used as access port or trunk port. The function of access port and trunk port are different.

The switch provide a single broadcast domain to all connected devices by default. Each port of switch creates single collision domain. VLAN breaks the broadcast domain into small broadcast domain. If we need to make communication between different VLANs then we need a router. Router have the feature to provide communication between different networks. VLAN provides the logical network within a single physical network.

VLAN basic concepts

Every switchport works on separate collision domain. We can say each device connected with a switchport remains in separate collision domain. By default all switchports of a switch works in a single broadcast domain. It can be define as all the devices working in a single LAN remains in a single broadcast domain. The big network of single broadcast domain can be divided into different small broadcast domains by creating the VLANs in the network. Every VLAN have its own broadcast domain.

Breaking the large broadcast domain into small broadcast domains provides an extra layer of security in the network. The devices of different broadcast domains can not communicate with each other. The swithports can be configured to restrict the unauthorised use by unwanted devices. Management of networking devices become easier by creating VLANs. Network administrator can monitor the small network more efficiently than a large network.

Methods of adding devices in VLAN

The devices can be added in a VLAN by two methods static and dynamic. Actually we configure the switchports for access by device with these methods. Generally static method assigned to the VLANs as it is easy and secure method. In static method we add the switchports manually to a VLAN. Suppose I assign the switchport number 4 to VLAN 10. This switchport remains assigned to VLAN unless we manually change it or assign to another VLAN. By default all switchports assigned to a single VLAN. We need to assign each port manually to the required VLAN.

The other method is dynamic assignment of swithports to VLAN according to the IP address of a device or MAC address of the device. Suppose a device connected to switchport 2 and it belongs to VLAN 20. If you change the switchport of this device from 2 to 10 then the switchport 10 automatically assigned to VLAN 20 and the device will work as it was. Dynamic method works in high end switches, in normal switch we can use static methods only.

You may also like to read --  Access and Trunk Ports for VLAN

Access port and Trunk port for VLAN basic concepts

Access ports allow a device to access the network by using the NIC or RJ45 connection. The devices connected to access ports remains in same broadcast domain. The device can access, receive and transmit the data via access port. Generally all switchports remains as access ports until we manually convert them to trunk ports.

Trunk port mode allow to transmit and receive the data of multiple VLANs. Generally endpoint devices not connected with trunk ports. The networking devices uses trunk ports to connect with each other. For example when we need to connect two switches which have multiple VLANs, the switches can be connected via trunk ports. The assignment of access ports and trunk ports are logical. A switchport mode can be changed by using the command line interface.

Access and Trunk ports belongs to Layer 3 switch. Function of Access and Trunk ports are different. According to name of ports access ports provide facility to flow the data packets through it. Trunk ports allow to pass the traffic  of multiple VLANs through it. Access and Trunk ports play an important role for creating VLANs in a LAN.

VLAN created on access ports in a layer 3 switch. Trunk ports provides connectivity between VLAN to VLAN from one switch to another switch. In this article we discuss only of basic of access and trunk ports. A switch-port can be assigned either access port of trunk port. It is not possible to assign both properties access and trunk ports to a single port.

VLAN to VLAN Access in Trunk Mode

The aim of the topic is to make communication between same VLANs in different switches. A single switch can provide connection to devices according to ports available in switch. I mean to say that a 24 port switch and connect maximum 24 devices with each other. What if we have more than 24 devices to connect in a VLAN network?

You may also like to read --  VLAN Basic Concepts

We require another switch to extend the VLAN network but the devices should remain in the same VLAN. Our purpose is to make communication between VLAN 10 of switch1 with VLAN 10 of switch2. I hope you understood the concept of VLAN to VLAN access in trunk mode. Trunk mode used to connect different switches for data transfer of all VLANs through trunk ports.

vlan to vlan access in trunk mode, ccna, ccna tutorials

Requirement of VLAN to VLAN access in trunk mode

I describe a scenario in previous paragraph. You can understood it better by examine the image above. Here we have three same departments which are far away. A single switch is not enough to provide connectivity beyond its port numbers. To increase the clients for same VLAN we require to establish a new switch.

The new switch have same VLAN configuration. Now our requirement is to provide communication between different clients in same VLAN between the different switches. In simple words we can say the HR VLAN of switch1 require to communicate with HR VLAN of switch2.

Configuration of VLANs in switch1 and switch2

I assume you know about the configuration of VLANs in a switch. I configure the VLANs in both switch from beginning. It may remind you some important commands. I take two switches and configure same two VLANs in both switches. The name of VLANs are HR and Accounts. I configure first 4 ports for VLAN HR and next 4 ports for VLAN Accounts.

In both switches PORT number 24 reserve as trunk port. Port 24 will transmit and receive the data of all VLANs simultaneously. We connect both switch with port 24 for trunk mode transportation. So before going to VLAN to VLAN Access in Trunk Mode we need the following configuration.

vlan to vlan access in trunk mode, ccna, ccna tutorials

You have to do the configuration of VLANs in both switches. I give an example for only one switch. See the below commands for configuration of VLANs in switch.

 Switch>enable
 Switch#config t
 Enter configuration commands, one per line. End with CNTL/Z.
 Switch(config)#vlan 10
 Switch(config-vlan)#name HR
 Switch(config-vlan)#exit
 Switch(config)#vlan 20
 Switch(config-vlan)#name Accounts
 Switch(config-vlan)#exit
 Switch(config)#do wr
 Building configuration...
 [OK]
 
 
 Switch#show vlan
 VLAN Name Status Ports
 ---- -------------------------------- --------- -------------------------------
 1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
 Fa0/5, Fa0/6, Fa0/7, Fa0/8
 Fa0/9, Fa0/10, Fa0/11, Fa0/12
 Fa0/13, Fa0/14, Fa0/15, Fa0/16
 Fa0/17, Fa0/18, Fa0/19, Fa0/20
 Fa0/21, Fa0/22, Fa0/23, Fa0/24
 Gig0/1, Gig0/2
 10 HR active  
 20 Accounts active  
 1002 fddi-default active  
 1003 token-ring-default active  
 1004 fddinet-default active  
 1005 trnet-default active  

See the below commands to assign the switchports to VLANs and make port 24 as trunk port.

 Switch>enable
 Switch#config t
 Switch(config)#interface FastEthernet0/1
 Switch(config-if)#switchport access vlan 10
 Switch(config-if)#exit
 Switch(config)#interface fastEthernet 0/2
 Switch(config-if)#switchport access vlan 10
 Switch(config-if)#exit
 Switch(config)#interface fastEthernet 0/5
 Switch(config-if)#switchport access vlan 20
 Switch(config-if)#exit
 Switch(config)#interface fastEthernet 0/6
 Switch(config-if)#switchport access vlan 20
 Switch(config-if)#exit
 Switch(config)#interface fastEthernet 0/24
 Switch(config-if)#switchport mode trunk  
 Switch(config-if)#exit
 Switch(config)#do wr
 Building configuration...
 [OK]
 Switch(config)#exit
 Switch# 

Assigning IP address to clients of VLAN HR.

We know that the configuration of VLAN is same in both switches. The network ID of clients in same VLAN should be same. For example i take the network ID for VLAN HR 192.168.1.0/24. According to this condition i assigned the IP address to the clients of VLAN HR as shown in figure. You have to assign the IP address manually for both PC1 and PC2. In this article I assigned IP address 192.168.1.2/24 to PC1 and 192.168.1.3/24 to PC2. After assigning IP address try to ping the PC1 with PC2. You will got the result as shown in command window below.

 C:\>ping 192.168.1.3
 Pinging 192.168.1.3 with 32 bytes of data:
 Reply from 192.168.1.3: bytes=32 time=1ms TTL=128
 Reply from 192.168.1.3: bytes=32 time=2ms TTL=128
 Reply from 192.168.1.3: bytes=32 time<1ms TTL=128
 Reply from 192.168.1.3: bytes=32 time<1ms TTL=128
 Ping statistics for 192.168.1.3:
 Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
 Approximate round trip times in milli-seconds:
 Minimum = 0ms, Maximum = 2ms, Average = 0ms
 C:\> 

Similarly you can try to make communication between other VLANs. Do it yourself you will found it useful. I hope you enjoyed and understood this article. For any query or suggestion on this article you may contact us or drop a comment below. Your suggestions are always welcome by us.

Share this article in your social circle :)
,

Leave a Reply

Your email address will not be published. Required fields are marked *