- — HOW-TO: Make Windows 7 Boot Faster
- — TWEAK: Filter Unread Emails in Gmail
- — TIP: Linux Virtual Machine Performance Tweaks
- — HOW-TO: Automated TV Series Downloads Using Raspberry-PI
- — FAQ: Mouse Randomly Freezing in Windows 7
- — TWEAK: Make Torrents Download Faster
HOW-TO: LAN Configuration of a Mikrotik Virtual Router
In the previous article, we discussed about the configuration of the Mikrotik router, with particular focus on connectivity and protection from unauthorized access. This time, we could start with specific services that it will provide to the local area network (LAN).
Configuring on the LAN side, requires that we prevent locking ourselves out of the router while executing changes. What does this mean? Any change that will potentially disconnect us from the router will be blocked. The router is smart enough to figure this out. In the Mikrotik linggo, the term used to refer to this is "safe mode". The name itself is very intuitive!
To enable safe mode, simultaneously press [CTRL]+[X] on the keyboard. The same set of hotkeys used for "cut" to those familiar with the Windows world. Upon enabling safe mode, the terminal prompt changes with the string ‹SAFE› appended to it. You will see that in the screenshot below.
To release safe mode, the same set of keys are used. Similarly, the prompt returns to normal and it shows that safe mode is no longer in effect.
Without further ado, let us configure the router to be able to perform DNS lookups for our network. This configuration forwards queries to Google's public DNS servers (18.104.22.168 and 22.214.171.124) at the same time caches the queries in the router's memory. Change the DNS servers to your own if Google's DNS servers are not desired.
set allow-remote-requests=yes cache-size=4098KiB servers=126.96.36.199,188.8.131.52
Next, let us prepare the network segments used on the LAN side by defining an IP pool. This will be used for DHCP services later. Let us assume a segment from 192.168.1.0/24.
add name=POOL1 ranges=192.168.1.11-192.168.1.239
Once the pool is defined, let's use that pool for DHCP services. This is done in two-parts. First, define the network segment.
/ip dhcp-server network
add address=192.168.1.0/24 comment=LOCAL_LAN dns-server=192.168.1.1 \
domain=pimp-my-rig.local gateway=192.168.1.1 \
Second, define the DHCP directive.
add add-arp=yes address-pool=POOL1 authoritative=yes disabled=no \
interface=ether3 lease-time=1d name=DHCP1
This configuration will not be complete without assigning the LAN gateway IP address to an existing interface on the router. In this case, it is ether3.
add address=192.168.1.1/24 comment=LOCAL_LAN interface=ether3 network=192.168.1.0
At this point, the router is able to provide communication between the devices in the local area network. It will be able to support devices that require dynamic host configuration protocol (or DHCP) for automatic configuration of IP addresses. Internet connectivity could not be established since the RFC1918 addresses (to which the 192.168.0.0/16 network belongs) are non-routable on the internet. What needs to happen is network address translation (or NAT). And the Mikrotik router is just as able to perform this task. We will discuss that in the next article.
RELATED: Initial Configuration of a Mikrotik Virtual Router
For now the router is able to provide network connectivity to hosts within the LAN. It could provide DHCP addresses and cache DNS queries. Please note that all capitalized configuration keywords (e.g. POOL1, DHCP1 and LOCAL_LAN) can be replaced with your own naming convention(s).