Site icon System Zone

MikroTik VLAN Routing Configuration with Manageable Switch

A VLAN (Virtual LAN) is a group of computers, servers, network printers and other network devices that behave as if they were connected to a single network. VLAN is a logical topology that divides a single broadcast domain into multiple broadcast domains. VLAN is a layer 2 method. So, a manageable switch is required to manage VLAN in your network and a router is required to route and control your inter-VLAN.

VLAN increases network security and performance as well as improves IT efficiency. So, it will be a better plan to implement VLAN in your network. If you have or manage MikroTik Router and manageable switch, VLAN implementation in your network is not so difficult. In this article, I will show how to easily configure inter-VLAN routing with MikroTik Router and manageable switch.

Core Devices and IP Information

To configure a VLAN network and inter-VLAN routing, I am using a MikroTik RouterBoard 1100 AHX2 (RouterOS v6.38.1) and Level One (GEP-2450) manageable switch. IP information that I am using for VLAN network configuration are given below.

This IP information is just for my R&D purpose. Change this information according to your network requirements.

Important VLAN Terms

There are two important VLAN terms that must keep under your knowledge otherwise you may face difficulty while configuring VLAN in your manage switch.

Network Diagram

To configure a VLAN network with MikroTik Router and manageable switch, I am following a network diagram like below image.

MikroTik VLAN with Manageable Switch

In this network, MikroTik Router’s WAN (ether1) interface is connected to ISP having IP Address 192.168.30.2/30 and ether2 interface which is connected to a manageable switch is MikroTik’s LAN interface. We will create three VLAN (VLAN 20, VLAN 30 and VLAN 40) in LAN interface and its network will be 10.10.20.0/24, 10.10.30.0/24 and 10.10.40.0/24 respectively. We will configure inter-VLAN routing in our MikroTik Router and we will also configure VLAN in our manage switch (Level One GEP-2450) where 1-5 ports will keep under VLAN 20 (for Marketing Department), 6-10 ports will keep under VLAN 30 (for Sales Department), 11-15 ports will keep under VLAN 40 (for HR Department) and 16-23 ports will keep under default VLAN 1. Port 24 will be trunk port and other ports are access port.

MikroTik Inter VLAN Routing Configuration with Manageable Switch 

We will now start inter-VLAN routing configuration. Complete VLAN configuration can be divided into two parts.

Part 1: Inter VLAN Routing Configuration in MikroTik Router

If multiple VLANs are implemented on a manageable switch, a router is required to provide communication between these VLANs. We know that switch is a layer 2 device. So, switch forwards only Ethernet header and cannot check IP header. For this reason, we must use a router that will work as a gateway for each VLAN. Without a router, a host is unable to communicate outside of its own VLAN. Routing process between VLANs is knows as inter-VLAN routing.

To configure inter-VLAN routing, we will create a trunk link between MikroTik Router and our manage switch that will carry traffic from three VLANs (VLAN 20 and VLAN 30 and VLAN 40). The following steps will show how to configure inter-VLAN routing as well as other basic configuration in our MikroTik Router.

VLAN Interface List

Inter VLAN routing and other basic configuration in MikroTik Router has been completed. Now MikroTik Router is ready to route VLAN 20, VLAN 30 and VLAN 40. In the next part, we will configure VLAN in our Level One manageable switch.

Part 2: VLAN Configuration in Manageable Switch

In this part, we will create our three VLANs (VLAN 20, VLAN 30 and VLAN 40) and configure access port and trunk port in our manage switch. Any manageable switch can be used for this purpose. As I have Level One (GEP-2450) switch available, I am doing VLAN configuration in this manage switch. If you have other manageable switch, find the manual in Google about how to configure VLAN in that specific manage switch.

Level One (GEP-2450) switch is a web smart manageable switch. So, we can manage this switch using web GUI. GEP-2450 switch has 24 Ethernet port. Among them, we will use 1-5 ports as VLAN 20 access port for Marketing Department, 6-10 ports as VLAN 30 access port for Sales Department, 11-15 ports as VLAN 40 access port for HR Department and 16-23 ports will keep under default VLAN 1. Port 24 will be used as trunk port and all other ports will be used as access port.  The following steps will show you how to configure VLAN in Level One (GEP-2450) switch properly.

VLAN configuration in Level One (GEP-2450) switch has been completed. VLAN Group page now looks like below image.

VLAN Configuration in Level One (GEP-2450) Switch

Now connect your Marketing PC to 1-5 ports, Sales PC to 6-10 ports and HR PC to 11-15 ports. If everything is OK, your desired PC will be able to get internet connection through your manage switch and MikroTik Router.

Block Inter VLAN Communication

Sometimes it may be your requirements to block inter VLAN communication. For example, you may want that your Marketing Department cannot communicate with Sales Department. In this case, you have to apply firewall rule to block inter VLAN communication because by default MikroTik allow inter VLAN communication. The following steps will show how to create firewall rule to block inter-VLAN communication.

This firewall rule blocks all TCP connections coming from Marketing PC to Sales PC. Similarly, you can block all TCP connections or UDP connections coming from Sales PC to Marketing PC by creating another firewall rule and changing source address block, destination address block and protocol.

If you face any confusion to follow above steps properly, watch my video tutorial about MikroTik VLAN routing configuration with manageable switch. I hope it will reduce your any confusion.

MikroTik inter-VLAN routing configuration with manageable switch has been discussed in this article. I hope, you will be able to create VLAN in your network with MikroTik Router and manageable switch. However, if you face any confusion while configuring VLAN, feel free to discuss in comment or contact with me from Contact page. I will try my best to stay with you.

Exit mobile version