Configure eth0 to use two routers

Issues related to configuring your network
Post Reply
laurielounge
Posts: 6
Joined: 2008/02/18 22:00:09

Configure eth0 to use two routers

Post by laurielounge » 2008/02/18 22:09:08

Hi there,

I've got eth0 set to 172.16.1.5.

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

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

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

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

Thoughts?

Regards,

Laurie McIntosh

Steve_K
Posts: 6
Joined: 2007/10/03 09:40:42

Configure eth0 to use two routers

Post by Steve_K » 2008/02/19 09:50:04

Hi,

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.

Cheers,
Steve

laurielounge
Posts: 6
Joined: 2008/02/18 22:00:09

Re: Configure eth0 to use two routers

Post by laurielounge » 2008/02/25 00:05:12

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.

Regards,

Laurie McIntosh

Post Reply