Sunday, June 20, 2021

Mikrotik Connect Two VLAN

In this tutorial, we are going to discuss “Vlan Configuration” on the Mikrotik router. And then we will discuss, how to route traffic between those VLANs or inter-VLAN routing. Here, we will create Vlan-100 and Vlan-200 to work with this lab. Let's start:-

First, we will create a separate bridge interface for each VLAN.  And then, we will associate one physical interface with those bridge interfaces as a bridge port so that, those physical interfaces can act as a default gateway for that VLAN.

Go to the “Bridge” menu and create two bridge interfaces. Here, we are creating two bridge interfaces because our VLAN quantity is two. One bridge interface is for VLAN-100 and another one is for VLAN-200.


Here, we have named the bridge interface as like as our VLAN number. This is completely optional. Anything you can be named.


After creating the interface, this will be look liked:-


Now we will associate one physical interface with each of those bridge interfaces. If you have required, you can associate one or more physical interfaces with one bridge interface. Then, these physical interfaces will be called “Bridge Port”.

To associate bridge port, go to the “ports” tab and click add (+) sign.


In this lesson, we will be going to associate "ether-8" with Bridge_Vlan-100 and "ether-9" with Bridge_Vlan-200. After creating the VLAN-id 100 and VLAN-id 200 and assigning them those bridge interfaces (Bridge_Vlan-100 and Bridge_Vlan-200) respectively, then all hosts connected to "ether-8" will be considered as VLAN-100 member, and all hosts connected to "ether-9" will be considered as VLAN-200 members.


After completing the task, this will be look like:-


Now, we have to create the VLAN interface or VLAN-id. To create VLAN, go to the “Interface” menu and select the “VLAN” tab. Click “add” or (+) sign.


Now, write your VLAN name, ID and select your parent interface. This VLAN ID will be assigned with that parent interface. This means that interface will be treated under this VLAN. In our case, the parent interface will be “Bridge_Vlan-100” for VLAN-100 and interface “Bridge_vlan-200” for VLAN-200. Just like the below:-


VLAN name is optional. It can be anything. No need to match with VLAN-id. For Vlan-200, this will be:-


 After completing the task, this will be as like:-


From now on, all hosts connected to “ether-8” under the VLAN-100 and all hosts connected to “ether-9”, under the VLAN-200.

Now we have to configure the IP address for the default gateway for those VLAN members. Otherwise, the member of the VLAN-100 can’t communicate with the member of the VLAN-200. We will have to assign IP addresses to our bridge interfaces. Our bridge interfaces will perform an inter-VLAN routing process. In this lesson, we are going to use “192.168.1.1/24” as our interface “Bridge_vlan-100” address and “172.16.1.1/24” as our interface “Bridge_Vlan-200” address. Here the IP address “192.168.1.1” performs as a default gateway for VLAN-100 members and the IP address “172.16.1.1” performs as a default gateway for VLAN-200 members. 

To assign IP addresses, we will go to the “IP” section from the menu and then we will select the “address” section from the sub-menu. The IP address for the interface Bridge_Vlan-100 is:-


And for the interface “Bridge_Vlan-200” is:-


Everything is done. Now assign the default gateway address to all VLAN members.  Configure your all host's computers for the default gateway as their gateway address. Both VLANs can communicate with each other. 

No comments:

Post a Comment