Create a multi-homed linux load balancer with two internet connections and one LAN connection
With the assistance of a few friends helping me research this, I was FINALLY able to get it working.
Had to run this script in order to properly forward TCP/IP traffic:
#!/bin/sh
PATH=/usr/sbin:/sbin:/bin:/usr/bin
# Primary Connection - 2085426230
IF1=eth0
IP1=172.16.0.2
P1=172.16.0.1
P1_NET=172.16.0.0
# Secondary Connection - 2085420213
IF2=eth1
IP2=172.16.1.2
P2=172.16.1.1
P2_NET=172.16.1.0
# Local Network
IF3=eth2
IP3=172.16.2.2
P3=172.16.2.1
P3_NET=172.16.2.0
T1=WAN1
T2=WAN2
# delete all existing rules.
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
# Always accept loopback and WAN traffic
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i ${IF1} -j ACCEPT
# Allow established connections, and those not coming from the outside
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i ${IF1} -o ${IF3} -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allow outgoing connections from the LAN side.
iptables -A FORWARD -i ${IF3} -o ${IF1} -j ACCEPT
# Masquerade.
iptables -t nat -A POSTROUTING -o ${IF1} -j MASQUERADE
# Enable routing.
echo 1 > /proc/sys/net/ipv4/ip_forward
Then I installed Net-ISP-Balance. Once the scripts ran and installed, I went to WhatsMyIP twice and sure enough, both interfaces are routing traffic as whatsmyip showed both IP addresses after I hit the refresh.
DISCLAIMER This worked for my particular network layout, configuration and settings. Your results may vary.