LEDE/OpenWRT — Setting Up Multi-WAN

Jul 13, 2016 · 4 min read

Multi-WAN manages your traffic over multiple WAN interfaces, routes individual sessions over the least busy WAN interface and that session continues to use the same WAN until terminated.

This guide assumes that you already have your interfaces and other settings configured correctly, as it will only cover the Multi-WAN specific setup steps.

SSH to your LEDE/OpenWRT device

If you are using Windows then start PuTTY and click Session on the left side, select SSH from the options, and then enter in the IP Address of your LEDE/OpenWRT box into the Host Name field.

Once you’ve done this just click on Open to start up the SSH connection.

Image for post
Image for post

If you are connecting via terminal, then just SSH to your device using the following command, where is your device’s IP address.

Installing Packages

First up we need to download the multiwan package that is going to help us configure this.

Run the following commands:

Now we need to enable multiwan, so run the following commands:


Now we need to make some changes to the multiwan configuration, so run the following to edit it’s config file:

Change/add the following to the configuration:

Once this is done, restart the multiwan process by running the following:

WAN Interfaces

Now edit the same config file again and change/add the following lines, making sure to tweak to your specific needs:

Once again, restart the multiwan process by running the following once you are done:

Outbound Rules

For setting outbound traffic rules you will need to change/add the follow to the same config file, changing the variables as you need:

Then again, restart the multiwan process by running the following once you are done:

Multiwan Setup

The next steps will outline creating your multiwan setup.

Create VLAN

First off we need to define a vlan for WAN2, so run the following command:

Configure VLANs and Network Interfaces

Run the following command to open the network config file:

We need to move LAN port 0 from default eth0_0 to eth0_2, and Configure WAN and WAN2 proto as dhcp.

Multiwan’s documentation provides us with the following example network config setup to follow.

Please note that port numbers can vary between device, so double check what they are for your specific device.

Configure WAN & Multiwan

Once that is complete, we can now configure WAN and Multiwan to work together. The easiest way to do this is via the LuCi interface.

For the WAN setup we need to do the following:

Head into Network > Interfaces > WAN/WAN2 and add WAN2 to the WAN firewall zone.

For Multiwan, we need to carry out these steps:

Head into Network > Multiwan and tweak the following:

  • You can remove any unused WAN interfaces here
  • Set load balancer distribution to your desired levels
  • Set failover to LoadBalancer

Save all of your changes and give your device one last reboot.

Everything should be configured now, so give your device a test to make sure everything is working.

If you found this post helpful please let us know by clicking the ♥ below.

This blog was brought to you by Cucumber Wi-Fi. Cucumber helps you run a more efficient Wi-Fi network. Check it out here.

Cucumber Wi-Fi — control any (Wi-Fi) device from the cloud.

LEDE/OpenWrt & IoT

Tutorials based on LEDE/OpenWrt from CT WiFi

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store