After a month of googling around I was able to find a (not so perfect) solution on how to use multiple internet connections.
First of all, I would like to inform everyone that i'm a complete n00b. I haven't finished any IT course yet. It's been four years already since i started using linux, but I still consider myself as linux newbie since I can't spend much time on it. I also consider myself as a script kiddie since I just copy things from other clever people... Also, please forgive my english because i'm not a native english speaker. Ok so much for the talk! Let's dive in!
My LINUX ROUTER/Gateway/Server (whatever it is called ):
CPU : Intel(R) Pentium(R) 4 CPU 2.40GHz HT
Memory: 1024 MB
OS : of course Gentoo Linux
Kernel : 2.6.9-rc4-love1 aka "It's Alive!" (SMP + NPTL + CFQ)
(patched with Julian Anastasov's patches)
patch is available at http://www.ssi.bg/~ja/#combinations
(patch-2.6.9-ja1.diff << patches cleanly on 2.6.9-rc4-love1)
make sure kernel is properly configured
NICs : eth0 - internal LAN (192.168.2.0/24)
ip address: 192.168.2.254
eth1 - external connection - ISP1 (10.10.10.72/29)*
ip address: 10.10.10.74
gateway ip address: 10.10.10.73
eth2 - external connection - ISP2 (20.20.20.176/29)*
ip address: 20.20.20.179
gateway ip address: 20.20.20.182
*real ip address changed for security reasons ^_^
Code: Select all
#Start of Script ---------------------------------
ISP1_IP=10.10.10.74
ISP1_GW=10.10.10.73
ISP2_IP=20.20.20.177
ISP2_GW=20.20.20.182
ip rule add prio 50 table main
ip route del default table main
ip rule add prio 201 from $ISP1_IP table 201
ip route add default via $ISP1_GW dev eth1 src $ISP1_IP proto static table 201
ip route append prohibit default table 201 metric 1 proto static
ip rule add prio 202 from $ISP2_IP table 202
ip route add default via $ISP2_GW dev eth2 src $ISP2_IP proto static table 202
ip route append prohibit default table 202 metric 1 proto static
ip rule add prio 222 table 222
ip route add default table 222 proto static \
nexthop via $ISP1_GW dev eth1 weight 1 \
nexthop via $ISP2_GW dev eth2 weight 1
#end of scriptCode: Select all
iface_eth0="192.168.2.254 broadcast 192.168.2.255 netmask 255.255.255.0"
iface_eth1="10.10.10.74 broadcast 10.10.10.79 netmask 255.255.255.248"
iface_eth2="20.20.20.177 broadcast 20.20.20.183 netmask 255.255.255.248"
gateway="eth1/10.10.10.73"
Problems encountered:
Some online games' having a hard time connecting to their respective servers. Possible solution is to just route those games to just use one internet connection (unfortunately i don't know how to do this). The above script worked on my setup, please post here if you have encountered some problems and if you have made some workaround to that problem please share it with us.
Special thanks to the following:
Julian Anastasov - author of the patch (http://www.ssi.bg/~ja/#combinations)
Christoph Simon - author of the Nano HowTo (his howto was primary reference) [http://www.ssi.bg/~ja/nano.txt]
Fernando Favero - for posting his success story (http://www.spinics.net/lists/lartc/msg13794.html)
and most of all to the Most High God.
(i hope routing gurus out there will post their ideas here ^_^)

