Page 1 of 1

Configure eth0 to use two routers

Posted: 2008/02/18 22:09:08
by laurielounge
Hi there,

I've got eth0 set to

I've got two DSL routers set to and, with different external ip addresses (two accounts)

I'm running Apache and qmail. I'd like qmail to receive and send mail on and only get apache traffic through

Possible? I think what I'm trying to do is route port 110 and 25 traffic through and port 80 and 443 traffic through

Would this all be a lot easier if the routers were set to different subnets?



Laurie McIntosh

Configure eth0 to use two routers

Posted: 2008/02/19 09:50:04
by Steve_K

Yes I think this would be a lot easier if you set them to two different subnets! There's not really a sensible way I can think of off the top of my head to do what you want. That said, I suspect this is possible with IPTables, but I don't know how to do it.

If you set the routers up to use different subnets, then you can have two different interfaces on your CentOS server, and bind the apache and qmail dameons to specific interfaces, so they're only listening on the interface connected to the router for that particular type of traffic.

Obviously you then need to set your DNS up appropriately.

However, is there any particular reason you're using two seperate networks in this manor? If it's for load, then I'd suggest it's easier just to get a larger connection, and you haven't really got any resiliancy in this model.

Some ISPs will offer bonded DSL, in which they will take your two accounts and bond them into a single 'pipe' - this may be a better option.


Re: Configure eth0 to use two routers

Posted: 2008/02/25 00:05:12
by laurielounge
Hi Steve,

Thanks for your reply. Your thoughts echo mine.

I'm thinking of trying this for ISP billing reasons - Apache's dealing with a small amount of traffic, while qmail's dealing with a lot of traffic. My ISP bill is high due to the email traffic, probably incoming spam traffic, so I want to set up a flat rate but slow upload account for email, and a faster, but capped rate account for apache.

That said, I'm now thinking down a slightly different approach - if, as I suspect the high bandwidth on mail is due to incoming spam, I can just set up the new account and router, set up dns to point externally to the new router's ip, and just forward that traffic to qmail, and let outgoing traffic continue going through the original connection...

Thanks for taking the time to reply Steve.


Laurie McIntosh