Freifunk Virtualized on ESX

PUBLISHED ON OCT 27, 2018 / 2 MIN READ

This is not a step-by-step guide, but serves as documentation and a helpful reference only!

For quite some time I have been running my guest Wi-Fi using a Freifunk router.

To do this, I disabled the Wi-Fi on the Freifunk plastic router and fed only the Freifunk network into my MikroTik router (http://mikrotik.com). I skipped the meshing.

The MikroTik then provisions the Freifunk Wi-Fi to the existing access points with its own SSID “Freifunk”.

As part of an optimization and cable reduction effort, I thought it might be possible to move this into a VM. The ESX runs 24/7 anyway! I can then also offer this to my customers.

There are a few hurdles to overcome:

  • The right Freifunk firmware image must be found.

  • The VM must be set up.

  • The ESX network stack must be switched to promiscuous mode.

  • The virtual network interfaces must be assigned correctly to the VM.

Freifunk Image (Gluon)

Since the offloader VM runs in Hamburg, I used the corresponding firmware. According to Freifunk HH, it can be found on the update servers: https://updates.hamburg.freifunk.net/

In my case under /ffhh-ost/stable/factory/ the image with the extension x86-64.vmdk

Please ask your local community!

Setting Up the VM

On my ESX 6.7 I created a new VM without a hard disk:

  • Guest OS: Linux, Debian GNU/Linux 9 (64-bit)

  • 1 CPU

  • 128MB RAM should be enough

  • 2 virtual network adapters of type E1000e

  • No SCSI controller, CD-ROM, USB, …

After creating the VM, the firmware image (.vmdk) is uploaded into the VM’s directory and attached to the VM:

  • SATA controller

  • Hard disk: IDE controller 1 - Master

Promiscuous Mode!

Without this find https://www.nico-maas.de/?p=1320 I wouldn’t have managed!

“[…]On your ESXi Server, go to Configuration, Network and edit your vSwitch. Allow Promiscuous Mode, MAC Change and Fake Transmissions.

After that, go to Configuration, Software, Advanced Settings - to the “Net” section and change Net.ReversePathFwdCheckPromisc to 1[…]”

Assigning the Virtual Interfaces

Now the tricky part… The network adapters are configured as follows:

  • For initial setup/config: Network adapter 1: connect so that you can reach the DHCP server running there!

  • For operation: Network adapter 1 (vNIC1) becomes the WAN port of the Freifunk router, Network adapter 2 (vNIC2) becomes part of the Freifunk network.

In my case I handled the reachability of the adapter for configuration vs. operation via a VLAN and an access port.

In LEDE, vNIC2 is “down”:

ip a|more

(a ping 9.9.9.9 should already work! If you are unsure about the interface assignment, write down the MAC addresses.)

and is not part of the Freifunk client network. So we add it via the shell:

uci add_list network.client.ifname=eth1
uci commit
/etc/init.d/network restart

Once everything is running:

batctl o

will already show other nodes!

Password

Use:

passwd

to set a password, then you can also reach the VM from your network via SSH.