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

Notices


Reply
  Search this Thread
Old 05-22-2010, 02:27 AM   #1
radioradio
Member
 
Registered: Nov 2004
Location: East UK
Distribution: Mandriva 2006 Discovery, SUSE 10.0, Red Hat, Knoppix
Posts: 47

Rep: Reputation: 15
[SOLVED] - Two adsl lines, two ether cards - how to route...


Hi,

running Fedora 12 and Webmin.. (Webmin is a lifesaver as it removes the need to delve into murky config files....)

I have a 4-port aDSL card (plan to use bonded aDSL).
I have connections to two ISPs (obviously with different static IPs.
I have TWO ethernet cards in the computer.

I want to route one aDSL line to eth0 and one aDSL line to eth1.

Each ISP has given me a block of 8 static IPS (5 usable).

(actually it's two lines to the same ISP but for this purpose that is irrelevant..).

I can use webmin to use default route to route:

my laptop -> eth0 -> ppp0 (adsl0)
Or to ppp1 (adsl1)

The problem I am having is routing both:

a laptop -> eth0 -> ppp0
another computer -> eth1 -> ppp1

I know it's a static routing / maybe prerouting issue but I am a bit stumped.

Maybe I need to remove the default route and have two static routes..?

Any pointers appreciated.

Last edited by radioradio; 05-25-2010 at 01:11 PM.
 
Old 05-22-2010, 07:59 AM   #2
radioradio
Member
 
Registered: Nov 2004
Location: East UK
Distribution: Mandriva 2006 Discovery, SUSE 10.0, Red Hat, Knoppix
Posts: 47

Original Poster
Rep: Reputation: 15
Help please!!

I am sure it is an iptables / prerouting issue, but my brain is slowly leaking like jelly out of my ears...

Thanks all..
 
Old 05-22-2010, 08:14 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
IDK but try searching for "load balancing", "multi link" and failover.
 
Old 05-22-2010, 10:37 AM   #4
radioradio
Member
 
Registered: Nov 2004
Location: East UK
Distribution: Mandriva 2006 Discovery, SUSE 10.0, Red Hat, Knoppix
Posts: 47

Original Poster
Rep: Reputation: 15
Thanks, but I don't want load balancing or failover .... just simply the ability to route one ethernet port / static IP to one aDSL line and the second port to the other aDSL line.

FYI this is a trial before I go to (hopefully) MLPPP bonded with the two lines combined into one, but I want to throughly test both lines individually and let them settle down before I get them bonded.
 
Old 05-22-2010, 10:45 AM   #5
djsmiley2k
Member
 
Registered: Feb 2005
Location: Coventry, UK
Distribution: Home: Gentoo x86/amd64, Debian ppc. Work: Ubuntu, SuSe, CentOS
Posts: 343
Blog Entries: 1

Rep: Reputation: 72
Quote:
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
This is an obscure one documented so people know how to do it. This sets all of the class D (multicast) IP routes to go via "eth0". This is the correct normal configuration line with a multicasting kernel.
So swap that out for the different interfaces and ips (not sure how it'll take to it if both IPs are in the same network, but you can just change up the mask to fit I'd guess) and then bobs your uncle hopefully
 
Old 05-22-2010, 11:08 AM   #6
radioradio
Member
 
Registered: Nov 2004
Location: East UK
Distribution: Mandriva 2006 Discovery, SUSE 10.0, Red Hat, Knoppix
Posts: 47

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by djsmiley2k View Post
So swap that out for the different interfaces and ips (not sure how it'll take to it if both IPs are in the same network, but you can just change up the mask to fit I'd guess) and then bobs your uncle hopefully
Hmm thanks..

I have two /29 static IP ranges each with 5 usuable IPs (obviously). 78.32.33.22/29 and 185.33.22.55/29 (those are from memory so are probably not right - but the point I am making is, the two external IP ranges on the two separarte aDSL interfaces are totally different.

As I say I want eth0 traffic to go via ppp0 and eth2 via ppp1 (yes I know, eth2 but it must have been the second ethernet card I tried so it's got assigned eth2 - not sure if this is significant but I doubt it).

I don't really want all of a class D to go down each interface (only 5 IPs in each case) but it's not a big deal if it works. However I would have thought with IPTables and Prerouting there would be a more elegant way (sorry, that sounds like implied criticism and I will give your suggestion a go...)

Thanks..
 
Old 05-22-2010, 11:30 AM   #7
radioradio
Member
 
Registered: Nov 2004
Location: East UK
Distribution: Mandriva 2006 Discovery, SUSE 10.0, Red Hat, Knoppix
Posts: 47

Original Poster
Rep: Reputation: 15
I suppose an additional complication I have not mentioned is that the aDSL modems are in the computer..

What I mean is, I have a 4-port aDSL PCI modem card... one of these .. http://www.traverse.com.au/productvi...product_id=116

I have it running fine on Fedora, the drivers are fine - but it does complicate things maybe, as the aDSL modems are not connected to the ethercards - the modems are in the computer..

Maybe however it makes life easier??

Anyway, thanks for looking!
 
Old 05-23-2010, 06:42 AM   #8
radioradio
Member
 
Registered: Nov 2004
Location: East UK
Distribution: Mandriva 2006 Discovery, SUSE 10.0, Red Hat, Knoppix
Posts: 47

Original Poster
Rep: Reputation: 15
Help please, anyone, someone!!

Thanks!
 
Old 05-24-2010, 11:17 AM   #9
Ipolit
Member
 
Registered: Nov 2003
Location: Bulgaria
Distribution: Vector Linux, Morphix
Posts: 321

Rep: Reputation: 33
Look at this, it is more complicated than your case
http://www.linuxquestions.org/questi...estion-784207/
The idea is to mark packages from your internal computers and to route packages according to those marks.

and when you set your router put only one default gw.
 
Old 05-25-2010, 01:07 PM   #10
radioradio
Member
 
Registered: Nov 2004
Location: East UK
Distribution: Mandriva 2006 Discovery, SUSE 10.0, Red Hat, Knoppix
Posts: 47

Original Poster
Rep: Reputation: 15
Finally sorted..

I think..

I setup two default routing tables, used iptables to mark packets from the second interface and route them according the the second default routing table...
 
Old 05-25-2010, 01:10 PM   #11
radioradio
Member
 
Registered: Nov 2004
Location: East UK
Distribution: Mandriva 2006 Discovery, SUSE 10.0, Red Hat, Knoppix
Posts: 47

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Ipolit View Post
Look at this, it is more complicated than your case
http://www.linuxquestions.org/questi...estion-784207/
The idea is to mark packages from your internal computers and to route packages according to those marks.

and when you set your router put only one default gw.
Yes the final iptables and SNAT solution is similar to my solution..
With in my case only one set of packets marked.

Thanks!
 
  


Reply


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
Route to ADSL modem davcefai Linux - Networking 3 10-17-2006 11:57 AM
Need to route traffic through specific nic cards... Thaidog Linux - Networking 4 07-01-2005 07:31 PM
Need help to route traffic properly with 2 eth cards mchan Linux - Networking 1 03-20-2005 07:55 PM
ADSL as a Alternate route or backup route bhagat2000 Linux - Networking 0 05-27-2004 03:17 PM
2 ether cards auto-routering tola Linux - Networking 1 08-17-2002 11:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:57 AM.

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