10

For a long time (2 years?) I have been running a virtual machine (Ubuntu 12.04 server) with a very basic outbound load balancing capability, sending different outbound connections out different ADSL routers.

Configured simply by using iproute with no NAT masquerade, NAT is managed by the outbound ADSL routers themselves allowing connections to route directly back to sender bypassing the load balancing router VM. There are also no firewall rules (iptables) on the router VM.

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

# flush initially
ip route flush cache

# remove whatever is there for the default to begin with
ip route delete default

# default load balancing rule
ip route add default scope global \
    nexthop via ${ROUTER2} dev ${INTERFACE} weight 6 \
    nexthop via ${ROUTER1} dev ${INTERFACE} weight 4

This has worked well for a long time.

I have recently upgraded (do-release-upgrade -d) the load balancer (Ubuntu 12.04 server virtual machine) to Ubuntu 14.04.

Since the upgrade internet connections using the above "ip route add default" command are causing sporadic connection issues and creating an unusable experience. Almost as if individual packets are being sent across both routers and not full connections.

This has been attempted with a second 14.04 virtual machine with the same effect.

I would love to have the same functionality on Ubuntu 14.04 (current kernel: 3.13.0-24). I don't understand what has changed.

Any suggestions?

MadHatter
  • 78,442
  • 20
  • 178
  • 229
Drew Anderson
  • 398
  • 1
  • 4
  • 12
  • A lot of people are complaining about network issues. Can you upgrade your kernel to 3.14? Here are some installation instructions: http://linuxg.net/how-to-install-kernel-3-14-rc6-on-ubuntu-and-linux-mint/ – Sacx Apr 29 '14 at 10:10
  • Upgrading to 3.14 killed the VM. Kernel panic. Maybe I didn't do it right, but I did follow those instructions. Meanwhile, I have downgraded to 12.04 (re-installed VM) to continue to use the old working functionality, support until 2017 is probably OK. – Drew Anderson Apr 30 '14 at 11:15
  • So people are aware, I am no longer in need of this solution (changed jobs) so I will not know if I can get this working in 14.04. – Drew Anderson Sep 22 '14 at 08:12
  • are both routers in the same L3 network? best to have 1 subnet per NIC/route. – user158798 Feb 28 '15 at 03:23

1 Answers1

2

I realize the original poster is no longer in need of a solution, but here's my take on the best solution for this issue. I also realize the poster would prefer to use Ubuntu, but configuring the routing rules manually like that isn't great for transferring ownership to others or even referencing yourself years later.

I personally would suggest a more robust setup using a PFSense VM to load balance the connections. I'd probably also suggest performing NAT on the PFSense box itself rather than on the modems. I have something similar to this configured in a VM and it works well.

For the connections between the modems and the PFSense VM, I use a vlan capable switch to connect 3 separate VLans to the VM, and break those out to 3 separate ports on the switch. This in effect provides a direct (virtual) cable from each modem to the pfsense box and another cable out to the lan. You can then configure the modems for passthrough, which varies from provider to provider.

It's true that this sidesteps the problem rather than addressing it directly, but putting the NAT on the modems themselves seems to me like just asking for trouble. Also, PFSense is specifically designed as a prepackaged router solution, so it supports and will continue to be tested with configurations like this, ensuring better reliability through upgrades.

stonecrusher
  • 135
  • 7