VirtualBox NAT Network

I wanted to tinker with Mikrotik RouterOS. One reason is Mikrotik equipment is used at work. I have much to learn about the devices.

Another reason is to consider using a Mikrotik router for the home network. I have used DD-WRT for many years but the upstream developers do not want to support the software in a professional manner. The software seems always broken. Obtaining security patches is hit-and-miss. The wiki is a mess and undependable. Browsing the forums requires a sixth sense to sift solutions. Despite years of use, I find the DD-WRT interface confusing with options scattered across multiple tabs.

The RouterOS software is robust and well tested. Security patches are routine, prompt, and do not break the software. Browsing the web finds many people with a high opinion of Mikrotik devices.

I have access to spare physical Mikrotik devices at work that I could use at home for tinkering. Instead I downloaded the Mikrotik virtual machine (VM). I use VirtualBox on the home network and a .vdi image is available. Creating a VM is straightforward.

Using the RouterOS command line interface is cryptic although there is a Mikrotik wiki topic to help with that interface. Typically that is not how RouterOS devices are accessed. The common method is using Winbox or the Webfig interface.

Winbox is a Windows only tool, which for Linux users means using WINE. I am able to use Winbox just fine from my VM I use to access work.

The Webfig interface is operating system agnostic and requires only a web browser. While I am a RouterOS novice, the web interface layout seems organized.

Using my work VM I wanted to concurrently access work servers and the RouterOS VM. I could not do this. I had to toggle the work VM between NAT and NAT Network. Unfortunately, the NAT Network mode eliminates Internet access, which means being unable to access work servers. I did not want to use Bridge mode because my work VM should be as isolated as possible from the host.

Some digging around the web indicates this is a common challenge. A common solution is to configure a second network card on the client VM. The first card is configured with NAT and the second with NAT network. The RouterOS VM only needs a single NAT Network interface.

VirtualBox is designed to default to 10.0.2.0/24 when using the NAT interface. The NAT Network interface needs to be on a different subnet.

The client VM needs a second network interface defined in the operating system. I am using Ubuntu MATE 16.04. I added the following to /etc/network/interfaces:

    auto eth1
    iface eth1 inet dhcp

The change requires restarting the networking service.

I can run Winbox on my VM, but I prefer the Webfig interface. That is unusual considering how much I detest the bane of the web, JavaScript. The web interface is responsive and snappy, unlike the sluggish interface of DD-WRT.

Simulating an actual Mikrotik device requires configuring VirtualBox to show multiple network interfaces. The VirtualBox GUI supports only four network interfaces but more may be added using the command line.

A much welcomed feature of RouterOS is all changes are real-time. No rebooting is required as is the common case with DD-WRT.

A caveat with RouterOS is the software is proprietary and not fully free/libre. While using the Linux kernel, the RouterOS software is only built on the kernel and is not a derivative of any upstream GPL software. This approach is within the spirit and letter of the kernel license. For me to pull away from DD-WRT, the proprietary nature might be a small price to pay for dependable and robust software.

Another peculiar caveat is Winbox is not natively supported in Linux based systems. Curious, because the RouterOS software uses the Linux kernel. The Webfig interface seems sufficient, but odd the Mikrotik developers don’t throw a bone to Linux users.

In case anybody is wondering, the OpenWRT/LEDE developers do not seem significantly more organized than the DD-WRT folks. The OpenWRT web site is confusing and a significant number of devices are not supported, included my current Asus router.

Posted: Category: Usability Tagged: General

Next: RouterOS and Proxmox

Previous: NFS Stale File Handles