0

At work we have two WAN access. I wish to install an Ubuntu server/router that shares these two WAN to our internal LAN.

I have prepared a box with three interfaces (eth0, eth1 and eth3):

  • eth0 will be used for the first WAN IP address, for example 172.16.1.19/29
  • eth1 will be used for the second WAN IP address, for example 172.16.4.107/29
  • eth3 will be the internal LAN, let's say 192.168.1.1/24

The current config is simple (/etc/network/interface)

....
iface eth0 inet static
    address 172.16.4.107
    netmask 255.255.255.248 
    gateway 172.16.4.106
    dns-nameservers 8.8.8.8

iface eth1 inet static
    address 172.16.1.19
    netmask 255.255.255.248 
    gateway 172.16.1.18
    dns-nameservers 8.8.8.8

.....

Will that kind of configuration share the two WAN, or will it randomly use one of them?

Is there a way to merge these two WAN to be considered as only one with a better bandwidth? If so, then how can we configure that?

5
  • Do you want a network bridge? If so, see the Arch Wiki's guide.
    – user423626
    Mar 29, 2016 at 6:23
  • askubuntu.com/questions/53499/…
    – nobody
    Mar 29, 2016 at 6:24
  • If the 2 wan are bridged, how the trafic will be shared on the 2 wan? Can for example we configur 1/3 of trafic on eth0 and 2/3 on eth1 ? Mar 29, 2016 at 6:38
  • And If the two wan are bounded, how the trafic will be shared on the two wan? Can for example we configure 1/3 of trafic on eth0 and 2/3 on eth1 ? Mar 29, 2016 at 6:57
  • 1
    I do **multihoming**/loadbalancing on OpenWRT with mwan3. The answer about Shorewalls MultiISP tools looks useful, the rest – with exception of gertvdijk's comments – appears to be misleading. Problems you might encounter: loadbalancing outbound client TLS connections, connection failover.
    – LiveWireBT
    Mar 29, 2016 at 9:00

3 Answers 3

2

Will that kind of configuration share the two WAN, or will it randomly use one of them?

The Linux kernel will only use one default gateway.

Is there a way to merge these two WAN to be considered as only one with a better bandwidth? If so, then how can we configure that?

unless you add a load-balancing route:

ip route add default scope global nexthop via 172.16.4.106 dev eth0 weight 1 nexthop via 172.16.1.18 dev eth1 weight 1

**note: weight (1/1) tells the kernel to evenly distribute the connections between the gateways

Then do this to enable forwarding:

echo 1 > /proc/sys/net/ipv4/ip_forward

source (try using this. it works pretty well on my setup)

2
  • forgot to add this: echo 1 > /proc/sys/net/ipv4/ip_forward otherwise, your ubuntu router will not forward packets May 24, 2016 at 8:53
  • Welcome to ask ubuntu :) can you please add the content of the comment above to your answer ?
    – storm
    May 24, 2016 at 9:09
0

As far a I know this can be implemented by setting some static routes. I had to configure an environment like this once, with access to 3 different networks:

  • Network 1: Internet access 15.186.51.0/27
  • Network 2: Laboratory access 10.24.10.0/24
  • Network 3: Wireless LAN 16.186.51.0/27

I had to specify what traffic should go to network2 and what to network3, and all of the rest to network1. So, if you think this could work for you, have a look at Howto add permanent static routes in Ubuntu.

This could be not what you need since every host in your network will requiere to modify the corresponding configuration if apply, and also in Windows it is less adaptable.

0

Take a look here which will lead you to here. Take also a look at here.

1
  • 1
    Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. Apr 27, 2016 at 21:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .