Differences

This shows you the differences between two versions of the page.

doc:uci:multiwan [2012/11/10 07:19]
uvray313
doc:uci:multiwan [2014/01/28 11:36] (current)
rand
Line 1: Line 1:
====== Multiwan ====== ====== Multiwan ======
-The //multiwan// package is an agent script that makes Multi-WAN configuration simple, easy to use and manageable. Comes complete with load balancing, failover and an easy to manage traffic ruleset. The uci configuration file ''/etc/config/multiwan'' is provided as part of the //multiwan// package.+The //multiwan// package is an agent script that makes Multi-WAN configuration simple, easy to use and manageable. It comes complete with load balancing, failover and an easy to manage traffic ruleset. The uci configuration file ''/etc/config/multiwan'' is provided as part of the //multiwan// package. 
 + 
 +Unlike "channel bonding" or "link aggregation" which routes individual ethernet frames, multiwan routes individual sessions over the least busy WAN interface and that session continues to use the same WAN until terminated. 
 + 
 +Note: Multiwan will NOT work if the WAN connections are on the same subnet and share the same default gateway. 
 + 
 +Note2: Multiwan (at least on Barrier Breaker r39404) does not accept WAN interfaces with "_" or other special characters
===== Installation ===== ===== Installation =====
Line 11: Line 17:
You should now find the //multiwan// configuration page under Network -> Multi-WAN You should now find the //multiwan// configuration page under Network -> Multi-WAN
-==== With the Commandline Interface (CLI) ====+==== With Command Line Interface (CLI) ====
<code> <code>
opkg update opkg update
Line 20: Line 26:
</code> </code>
-===== Configuration File Sections =====+===== Configuration ===== 
 +==== With Command Line Interface (CLI) ====
-==== General options ====+=== General options ===
<code> <code>
config 'multiwan' 'config' config 'multiwan' 'config'
Line 54: Line 61:
It seems that ''fastbalancer'' is superior to ''balancer'' in terms of stability but you will need to try each setting to see which works best for you. It seems that ''fastbalancer'' is superior to ''balancer'' in terms of stability but you will need to try each setting to see which works best for you.
-==== WAN Interfaces ====+=== WAN Interfaces ===
<code> <code>
config 'interface' 'wan' config 'interface' 'wan'
Line 112: Line 119:
</code> </code>
-==== Outbound Traffic Rules ====+=== Outbound Traffic Rules ===
In the case of duplicate rule entries, the last rule will take precedent. In the case of duplicate rule entries, the last rule will take precedent.
<code> <code>
Line 141: Line 148:
</code> </code>
-==== Quick Multiwan setup guide by AndyBallon ====+===== Simple Multiwan Setup =====
-andyballon made a quick installation guide and post it in https://forum.openwrt.org/viewtopic.php?id=23904&p=3 post #75 
-=== 1. Install Backfire 10.03 === 
-=== 2. Create VLAN for WAN2 ===+==== 1. Create VLAN for WAN2 ===
 +<code> 
 +vconfig add eth0 2 
 +</code>
 +==== 2. Configure VLANs and Network Interfaces ====
Using  ''/etc/config/network.'' Using  ''/etc/config/network.''
-:!: I moved port "0" from eth0_0 to eth0_2.+  * Move LAN port "0" from default eth0_0 to eth0_2.
-You can configure WAN and WAN2 proto as DHCP to start and then use the web interface to reconfigure to PPPOE or static IP later. +  * Configure WAN and WAN2 'proto' as 'dhcp' initially and use the web interface to reconfigure to PPPOE or static IP later if needed
-Use the same DNS servers I'm using if you're having DNS problems. Some ISPs only allow DNS connections from their own IP blocks.+ * Use the DNS servers configured below if you're having DNS problems. Some ISPs only allow DNS connections from their own IP blocks.
<code> <code>
 +# The following assumes a six port switch, the default WAN port is switch port 0,
 +# the default LAN ports (1-4) are switch ports (1-4) and the internal switch port
 +# connection to the router mainboard is switch port 5.
 +
 +# Although a common configuration, some routers are configured with a 5 port switch,
 +# a separate physical network interface for the WAN port and the numbering system
 +# may be different.
 +
config 'switch' 'eth0' config 'switch' 'eth0'
        option 'enable' '1'         option 'enable' '1'
 +# Note: The internal switch port 5 is tagged "5t" in the following configuration
 +# to allow it to be shared by multiple VLANs (eth0.0., eth0.1, eth0.2)
 +
 +# Configure 3 external LAN ports on VLAN0.
config 'switch_vlan' 'eth0_0' config 'switch_vlan' 'eth0_0'
        option 'device' 'eth0'         option 'device' 'eth0'
        option 'vlan' '0'         option 'vlan' '0'
-        option 'ports' '1 2 3 5'+        option 'ports' '2 3 4 5t'
 +# Configure default WAN port on VLAN1.
config 'switch_vlan' 'eth0_1' config 'switch_vlan' 'eth0_1'
        option 'device' 'eth0'         option 'device' 'eth0'
        option 'vlan' '1'         option 'vlan' '1'
-        option 'ports' '4 5'+        option 'ports' '1 5t'
 +# Configure WAN2 port on VLAN2.
config 'switch_vlan' 'eth0_2' config 'switch_vlan' 'eth0_2'
        option 'device' 'eth0'         option 'device' 'eth0'
        option 'vlan' '2'         option 'vlan' '2'
-        option 'ports' '0 5'+        option 'ports' '0 5t'
 +# Default loopback interface.
config 'interface' 'loopback' config 'interface' 'loopback'
        option 'ifname' 'lo'         option 'ifname' 'lo'
Line 181: Line 205:
        option 'netmask' '255.0.0.0'         option 'netmask' '255.0.0.0'
 +# Default 'lan' interface configured with Spanning Tree Protocol activated.
config 'interface' 'lan' config 'interface' 'lan'
        option 'type' 'bridge'         option 'type' 'bridge'
 +        # On some routers the default 'lan' interface is configured directly
 +        # to the physical network interface eth0. This has to be changed to
 +        # a VLAN, in this case eth0.0
        option 'ifname' 'eth0.0'         option 'ifname' 'eth0.0'
        option 'proto' 'static'         option 'proto' 'static'
Line 189: Line 217:
        option 'netmask' '255.255.255.0'         option 'netmask' '255.255.255.0'
 +# wan interface
config 'interface' 'wan' config 'interface' 'wan'
        option 'ifname' 'eth0.1'         option 'ifname' 'eth0.1'
        option 'proto' 'dhcp'         option 'proto' 'dhcp'
        option 'dns' '216.146.35.113 216.146.36.113 8.8.8.8 8.8.4.4'         option 'dns' '216.146.35.113 216.146.36.113 8.8.8.8 8.8.4.4'
-        option 'defaultroute' '0' 
-        option 'peerdns' '0' 
 +# wan2 interface
config 'interface' 'wan2' config 'interface' 'wan2'
        option 'ifname' 'eth0.2'         option 'ifname' 'eth0.2'
-        option 'dns' '216.146.35.113 216.146.36.113 8.8.8.8 8.8.4.4' 
        option 'proto' 'dhcp'         option 'proto' 'dhcp'
-        option 'defaultroute' '0' +        option 'dns' '216.146.35.113 216.146.36.113 8.8.8.8 8.8.4.4'
-        option 'peerdns' '0'+
</code> </code>
-=== 3. Install Packages === 
-Install luci-app-multiwan (which will install all the packages needed) 
-Reboot to refresh the web ui. I always need to do this otherwise the link does not show up in networking. +==== 3. Configure WANs and multiwan ====
- +
-=== 4. Configure WANs and multiwan ===+
== WANs: == == WANs: ==
Line 222: Line 244:
  * a. I only have two internet connections so I always remove the last two wan interfaces. I also comment out MWAN3 and MWAN4 in /etc/iproute2/rt_tables (although it may not be necessary).   * a. I only have two internet connections so I always remove the last two wan interfaces. I also comment out MWAN3 and MWAN4 in /etc/iproute2/rt_tables (although it may not be necessary).
  * b. Load Balancer Distribution = 1 for even connection distribution   * b. Load Balancer Distribution = 1 for even connection distribution
-:!: Unlike "channel bonding" or "link aggregation" which routes individual ethernet frames, //multiwan// routes each connection over the least busy WAN and that connection continues to use the same WAN until terminated.+
Failover = LoadBalancer for both links Failover = LoadBalancer for both links
  * c.Traffic Rules   * c.Traffic Rules
Line 231: Line 253:
that's it! that's it!
-=== 5. Test.===+==== 3. Test.====
  - Status > Interfaces should show traffic going through both interfaces.   - Status > Interfaces should show traffic going through both interfaces.
  - route distribution   - route distribution
Line 247: Line 269:
  - Disconnecting one WAN port should NOT interrupt your connection.   - Disconnecting one WAN port should NOT interrupt your connection.
-=== 6. Troubleshooting ===+==== 4. Troubleshooting ====
There's a problem if: There's a problem if:
  - you refresh the Interface status page and the transfer rates of one interface do not change.   - you refresh the Interface status page and the transfer rates of one interface do not change.

Back to top

doc/uci/multiwan.1352528379.txt.bz2 · Last modified: 2012/11/10 07:19 by uvray313