Application Example - MikroTik RouterOS v2.9 Reference Manual

Reference manual
Table of Contents

Advertisement

Application Example

VLAN example on MikroTik Routers
Let us assume that we have two or more MikroTik RouterOS routers connected with a hub.
Interfaces to the physical network, where VLAN is to be created is ether1 for all of them (it is
needed only for example simplification, it is NOT a must).
To connect computers through VLAN they must be connected physically and unique IP addresses
should be assigned them so that they could ping each other. Then on each of them the VLAN
interface should be created:
[admin@MikroTik] interface vlan> add name=test vlan-id=32 interface=ether1
[admin@MikroTik] interface vlan> print
Flags: X - disabled, R - running
#
NAME
0
R test
[admin@MikroTik] interface vlan>
If the interfaces were successfully created, both of them will be running. If computers are
connected incorrectly (through network device that does not retransmit or forward VLAN packets),
either both or one of the interfaces will not be running.
When the interface is running, IP addresses can be assigned to the VLAN interfaces.
On the Router 1:
[admin@MikroTik] ip address> add address=10.10.10.1/24 interface=test
[admin@MikroTik] ip address> print
Flags: X - disabled, I - invalid, D - dynamic
#
ADDRESS
0
10.0.0.204/24
1
10.20.0.1/24
2
10.10.10.1/24
[admin@MikroTik] ip address>
On the Router 2:
[admin@MikroTik] ip address> add address=10.10.10.2/24 interface=test
[admin@MikroTik] ip address> print
Flags: X - disabled, I - invalid, D - dynamic
#
ADDRESS
0
10.0.0.201/24
1
10.10.10.2/24
[admin@MikroTik] ip address>
If it set up correctly, then it is possible to ping Router 2 from Router 1 and vice versa:
[admin@MikroTik] ip address> /ping 10.10.10.1
10.10.10.1 64 byte pong: ttl=255 time=3 ms
10.10.10.1 64 byte pong: ttl=255 time=4 ms
10.10.10.1 64 byte pong: ttl=255 time=10 ms
10.10.10.1 64 byte pong: ttl=255 time=5 ms
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 3/10.5/10 ms
[admin@MikroTik] ip address> /ping 10.10.10.2
10.10.10.2 64 byte pong: ttl=255 time=10 ms
10.10.10.2 64 byte pong: ttl=255 time=11 ms
10.10.10.2 64 byte pong: ttl=255 time=10 ms
10.10.10.2 64 byte pong: ttl=255 time=13 ms
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 10/11/13 ms
[admin@MikroTik] ip address>
Copyright 1999-2007, MikroTik. All rights reserved. Mikrotik, RouterOS and RouterBOARD are trademarks of Mikrotikls SIA.
Other trademarks and registred trademarks mentioned herein are properties of their respective owners.
MTU
ARP
1500 enabled
NETWORK
BROADCAST
10.0.0.0
10.0.0.255
10.20.0.0
10.20.0.255
10.10.10.0
10.10.10.255
NETWORK
BROADCAST
10.0.0.0
10.0.0.255
10.10.10.0
10.10.10.255
VLAN-ID INTERFACE
32
ether1
INTERFACE
ether1
pc1
test
INTERFACE
ether1
test
Page 359 of 695

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the RouterOS v2.9 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents

Save PDF