Creating additional WAN interfaces for multi-WAN
The simplest way to create more WAN interfaces is to have a VLAN-capable router. This will allow you to convert existing LAN ports into individual ports to become its own separate interface and act as a WAN.
Here is the general procedure using LuCI to create a new VLAN and assign a single port to it in order to create a second WAN interface.
Routers using swconfig
Most router targets should now be using Distributed Switch Architecture (DSA) and therefore the swconfig instructions below are considered legacy for older devices or OpenWrt versions.
Go to Network > Switch
Remove a single physical port from the default
VLAN 1; this port will be the new physical WANB port
Assign the port to a new
VLAN number such as 3 and set the port to be untagged in this single new
VLAN and off in all other VLANs (note this
VLAN, as with all VLANs, should also include the built-in CPU port as a tagged member, so there are a total of two ports in the new
VLAN)
Reboot the router for the new
VLAN interface to become active (e.g. eth0.3 for what will be the new WANB interface)
Go to Network > Interfaces and add a new interface name for the new eth0.x adapter
Name the new
VLAN physical interface “wanb”
Configure the new wanb interface
IP details
Assign the new wanb interface to the wan firewall zone
For routers that have more than one CPU, make sure to only tag one of the CPUs for any new VLAN created. One methodology for dual-CPU routers is that CPU1 will often be assigned to the built in WAN port, and you can tag CPU0 for any VLANs you wish to create.
Routers using Distributed Switch Architecture (DSA)
From 21.02 onwards most targets will use DSA which is different and not compatible with the instructions for swconfig. You can find a converting to DSA guide for additional guidance for switch/VLAN management for router targets using DSA.
Go to Network > Interfaces and select the Devices tab. Click configure on the br-lan device.
Remove a lan port from the switch bridge ports option by selecting the menu and unchecking a switch port such as “lan1”. This port will become it's own
WAN port.
Apply these changes to remove the selected
LAN port from the
LAN bridge.
While still on the Devices page, scroll down and click the “Add device configuration”
For device type select “
VLAN (802.1q)”
For base device select the lan port e.g. lan1 which was removed from the
LAN bridge earlier.
Assign the desired
VLAN ID for this device.
Save the changes and apply.
Go to Network > Interfaces and “Add new interface”
Give the interface a name such as “wanb”
Select whatever protocol is required for this interface
DHCP, PPPoE etc. For device select the lan port you removed from br-lan earlier.
Assign the new interface to the wan firewall zone
Apply any remaining changes.
Note for PPPoE WAN interfaces: If you are using PPPoE for multiple ADSL lines from the same company or provider, you may need to use option macaddr 'XX:XX:XX:XX:XX:XX' to give each interface a unique MAC. A symptom of not doing is that the ISP will drop the connection on one line when another connects with the same (default) MAC.