Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 05-15-2003, 01:29 AM   #1
LQ Newbie
Registered: Mar 2003
Location: Canada
Distribution: gentoo
Posts: 21

Rep: Reputation: 15
Arrow Need some advice on setting up a network with two internet connections

Here's my story:

Next September, me and 11 other guys are moving in the same apartment block. They all are hardcore gamers and heavy p2p users. Instead of getting 4 separate internet connections, we thought it would be better to get only 1 and share it with a Linux router. The problem is, only two ISPs offer broadband services around here and they both have one severe downside - the first one, Videotron, has a very low latency but has a download limit of 10GB/month and the second one - AEI - has unlimited download/upload but is capped at 100 kb/s.

What i want to do is build a network in which the router would be connected to both ISPs and would redirect outgoing traffic to the appropriate connection (i.e. P2P and IRC traffic thru AEI and gaming / http traffic thru Videotron).

I've googled a lot and i can't find anything useful for my situation, but perhaps i didnt search for the right thing. I guess my question is: Is it possible to do such a thing with Linux and how can it be done?

I dont know much about tcp/ip and routing but i am willing to learn about it. Any suggestions or hints on how my "dream network" could be done would be greatly appreciated.

Thanks in advance,

Old 05-15-2003, 08:19 PM   #2
Senior Member
Registered: Sep 2002
Location: Philippines
Distribution: Slackware, RHEL&variants, AIX, SuSE
Posts: 1,127

Rep: Reputation: 49
i think u can do that within ur router - where u can redirect the traffice by specifying where this port access goes.

search for 'port redirection' - it might give u a hint.
Old 05-15-2003, 11:33 PM   #3
Registered: May 2003
Location: A country town, Australia
Distribution: Debian
Posts: 72

Rep: Reputation: 15
Wow, I wanna move in too, sounds like a permanent lanparty. I like the idea of having 2 ISP accounts... I suggest you have the cheap one as "default" and just pick off gaming/fast traffic to the faster one.

Have a read about iptables: Rusty's guides are a good place to start, he's fun. iptables redirect target allows you to grab traffic from one port and deliver it to the router's IP addr instead of where it was going. Then you will need some other software (like a proxy) to forward it to your choice of ISP. squid can do this "transparent redirection" for HTTP, dunno what to use for other protocols.

The other thing I'm wondering about is whether iptables can run two NAT sessions... one for LAN traffic to ISP 1, and another for LAN traffic to ISP 2. It probably can, but does anyone know for sure?
Old 05-16-2003, 06:29 AM   #4
Registered: Mar 2003
Distribution: Debian
Posts: 275

Rep: Reputation: 30

It will take a bit of work. Definiately read up on networking, maybe even buy a book. It will also need to be "maintained" a little, making sure the packets are going to the right place, checking the logs and such. That being said, it sounds like a fun project, I say give it a go. At least you'll learn something.

A google directory for some TCP/IP links.

Check out Linux Advanced Routing & Traffic Control HOWTO as well. It will talk about using two uplinks (routers) to the internet. It will also allow you to prioritize the packets, so gaming packets go first, then http. Dynamic rate limiting is good as well (no one can capitalize the connection.)

You may or may not want to run the cache. On one hand, it conserves bandwidth, but then again, I don't want my friends to have a log of every web site I visit .

Consider running a local mirror of the good stuff. Linux distros and such.

I would definately setup a test network (three machines) and try everything out before signing up. Use ethereal (a graphical packet sniffer and decoder) to see what is really going over the wire. Really, start using ethereal now, it's cool and shows you the nitty gritty. You could use User Mode Linux to set up 4 virtual machines that talk over a "virtual" network. More coolness.

How are you going to hook every one up? 802.11?

Have fun,
Old 05-16-2003, 09:05 AM   #5
LQ Newbie
Registered: Mar 2003
Location: Canada
Distribution: gentoo
Posts: 21

Original Poster
Rep: Reputation: 15
thx a lot for the hints guys Looks like this thing is gonna keep me busy for the summer, heh.. I'll post my progress in here from time to time

batard23: no, me and my friends will have the whole floor to ourselves , and i can get hubs from a fraction of the price, so we'll use conventional wires, even if its ugly maybe next year we'll all switch to 802.11.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Logging off root but retaining network/internet connections Murdock1979 Linux - Security 3 06-30-2005 04:52 PM
one network. two internet connections w3bbuilder Linux - Newbie 1 05-26-2005 01:03 AM
Problems setting up my internet connection, DSL with two network cards ALInux Linux - Networking 8 08-23-2004 02:48 PM
2 network cards, 2 network connections - routing problem tvojvodi Linux - Networking 4 02-24-2004 03:26 PM
Two possible connections to the Internet? vincebs Linux - Networking 3 01-21-2004 05:40 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:57 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration