Mikrotik VLAN configuration
Mikrotik VLAN configuration
By making use of VLANS you can make available multiple networks through a single network cable. These networks are completely separated from each other even though they use the same network. You do have two VLAN support routers / switches required. In this example I'm going to two Internet service providers (ISPs for short) make available on the second router board while anyway with one network cable is connected.
I use two boards router Mikrotik RB751G-2Hnd
Routerboard side ISP in the cupboard
This router board is installed in the meter box and is connected to the ISP via "ether1" (ISP1) and "ether2" (ISP2) The network which the first router board will connect with the second placed in the office 80 meters, will be connected be via "ether5".
The making of the necessary bridges
Click "bridge".
Click on the blue cross in order to create a bridge.
When "name" you give the bridge the name "br-ISP1". Click "apply" then "ok".
To create the second bridge you click back on the blue cross.
When "name" you give the bridge the name "br-ISP2". Click "apply" then "ok".
To add interfaces to the bridge, click on "ports", click on the blue cross.
Under "Interface" "ether1-ISP1", select to "bridge" "br-ISP1. The necessary interfaces I have now already given it a name. Click on" apply "then" ok ".
Click back on "ports" on the blue cross.
Under "Interface" "ether2-ISP2", select to "bridge" "br-ISP2", click "apply" then "ok".
The bridges that you created ensure that the interfaces such as "ether1-ISP1" can be merged with the "VLAN" we will create now. This bridge is to ensure that the two interfaces to act as a single network.
Create and configure VLANs.
Click "interfaces".
Click on the blue cross.
Select "VLAN".
- When "name" put "VLAN-ISP1"
- At "VLAN ID" you put a 1, "VLAN ID", the VLAN can be recognized, this is the identification of the VLAN.
- At "Interface", select "ether5-TRUNK." "ether5-TRUNK" will forward the created VLAN to the second router via the network.
- Click "apply" and "ok".
To create the second VLAN, click back on the blue cross.
Select "VLAN".
- When "name" put "VLAN-ISP2"
- At "VLAN ID" you put a second, with "VLAN ID", the VLAN can be recognized, this is the identification of the VLAN.
- At "Interface", select "ether5-TRUNK." "ether5-TRUNK" will forward the created VLAN to the second router via the network.
- Click "apply" and "ok".
The VLANS are created, now we have them in the right bridge.
Click "bridge".
Continue clicking to "ports", and click on the blue cross.
To "interface" select now "VLAN-ISP1, select at" bridge "" br-ISP1 ", click" apply "and" ok ".
Click on the blue cross.
To "interface" select now "VLAN-ISP2, select at" bridge "" br-ISP2 ", click" apply "and" ok ".
DHCP Client for ISP1 and ISP2
The first router board in the meter goes through the DHCP client will connect to the modems / routers from your ISP.
Click "ip" followed by "DHCP client".
Under "Interface" "br-ISP1", click "apply" and "OK" ISP1 is now connected to the first router board.
Click back on the blue cross.
Under "Interface" "br-ISP2, click" apply "and" ok ", ISP2 is now connected to the first router board.
Connect the two router boards
Unplug the network cable and connect the router boards together by "ether5-TRUNK." We're going to use a / 30 IP range to connect the router boards.
Click "IP" then "addresses".
Click on the blue cross, select at "Interface" "ether5-TRUNK", type in the "address" in 172.17.0.1/30. Click "apply" and "ok".
A trunk interface can send and receive data packets from different VLANS.
Routerboard side office
The making of the required bridge
Click "bridge".
Click on the blue cross in order to create a bridge.
When "name" you give the bridge the name "br-ISP1". Click "apply" then "ok".
To create the second bridge you click back on the blue cross.
When "name" you give the bridge the name "br-ISP2". Click "apply" then "ok".
To add interfaces to the bridge, click on "ports", click on the blue cross.
Under "Interface" "ether1-ISP1", select to "bridge" "br-ISP1. The necessary interfaces I have now already given it a name. Click on" apply "then" ok ".
Click back on "ports" on the blue cross.
Under "Interface" "ether2-ISP2", select to "bridge" "br-ISP2", click "apply" then "ok".
The bridges that you created ensure that the interfaces such as "ether1-ISP1" can be merged with the "VLAN" we will create now. This bridge is to ensure that the two interfaces to act as a single network.
Create and configure VLANs.
Click "interfaces".
Click on the blue cross.
Select "VLAN".
- When "name" put "VLAN-ISP1"
- At "VLAN ID" you put a 1, "VLAN ID" identifies the VLAN may be this is the identification of the VLAN.
- At "Interface", select "ether5-TRUNK." "ether5-TRUNK" will forward the created VLAN to the second router via the network.
- Click "apply" and "ok".
To create the second VLAN, click back on the blue cross.
Select "VLAN".
- When "name" put "VLAN-ISP2
- At "VLAN ID" you put a second, with "VLAN ID", the VLAN can be recognized, this is the identification of the VLAN.
- At "Interface", select "ether5-TRUNK." "ether5-TRUNK" will forward the created VLAN to the second router via the network.
- Click "apply" and "ok".
The VLANS are created, now we have them in the right bridge.
Click "bridge".
Continue clicking to "ports", and click on the blue cross.
To "interface" select now "VLAN-ISP1, select at" bridge "" br-ISP1 ", click" apply "and" ok ".
Click on the blue cross.
To "interface" select now "VLAN-ISP2", select at "bridge" "br-ISP2", click "apply" and "ok".
"Ether5-TRUNK" interface to assign an IP address.
Click "IP" then "addresses".
Click on the blue cross, select at "Interface" "ether5-TRUNK", type in the "address" in 172.17.0.2/30. Click "apply" and "ok".
CoS (Class of Service) set up VLANS
Within the VLAN tag, we have 3 bits which are available for setting CoS (priority) and go from 0 to 7, of which 0 is the lowest and 7 is the highest priority. By default, all CoS packets is set to 0. We use the bridge filter in order to set the priority.
The settings are made and complete, now you can at the office via "ether1" of the router board on ISP1 and via "ether2" on ISP2. This is a simple example of how VLAN works.
Comments