LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   [SOLVED] - Two adsl lines, two ether cards - how to route... (https://www.linuxquestions.org/questions/linux-networking-3/%5Bsolved%5D-two-adsl-lines-two-ether-cards-how-to-route-809426/)

radioradio 05-22-2010 02:27 AM

[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.

radioradio 05-22-2010 07:59 AM

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..

catkin 05-22-2010 08:14 AM

IDK but try searching for "load balancing", "multi link" and failover.

radioradio 05-22-2010 10:37 AM

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.

djsmiley2k 05-22-2010 10:45 AM

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 :)

radioradio 05-22-2010 11:08 AM

Quote:

Originally Posted by djsmiley2k (Post 3977674)
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..

radioradio 05-22-2010 11:30 AM

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!

radioradio 05-23-2010 06:42 AM

Help please, anyone, someone!!

Thanks!

Ipolit 05-24-2010 11:17 AM

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.

radioradio 05-25-2010 01:07 PM

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...

radioradio 05-25-2010 01:10 PM

Quote:

Originally Posted by Ipolit (Post 3979574)
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!


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