[lug] forcing certain services to use eth1 instead of eth0

Sean Reifschneider jafo at tummy.com
Thu Jan 5 17:49:08 MST 2006


On Wed, Jan 04, 2006 at 11:51:52AM -0700, Michael Belanger wrote:
>setting as the default gateway.   I manually altered the default gateway to 
>be on eth0 and eth0's gateway, but this seems to have caused traffic routing 
>to eth1 to be responding with eth0 for sending mail with SMTP.

Sure, but it will have the IP from eth1.  If you need it to route only over
eth1, you're going to have to do source routing, probably via fwmark.

>I infer from this behavior that though we ask sendmail to send from eth1, 
>sendmail just uses the default.  

You can make sendmail *BIND* to eth1, but leaving traffic will follow your
normal routing policies.  This is not magic, look at "netstat -nr" and the
entry that matches there is the one that is used.  If that says "eth0",
then it will be routed over eth0.  So, you have to specify a route that
says "if the source address is X, route it over the default gateway on
eth1. 

Thanks,
Sean
-- 
 The best way to predict the future is to invent it.
                 -- Alan Kay
Sean Reifschneider, Member of Technical Staff <jafo at tummy.com>
tummy.com, ltd. - Linux Consulting since 1995: Ask me about High Availability




More information about the LUG mailing list