How to make a mutli-homed host use one IP for a NAT'ed host

Taylor, Grant gtaylor at riverviewtech.net
Thu Apr 21 20:13:20 CEST 2005


> No need to appologies - and your up already!

Heh, ya the glorious life of a computer consultant. :)

> So I swapped to eth1 - and it would appear that packets are getting
> marked...

*nod*

> So the last few hurdles...
> 
> I need to use the same router - an ADSL thing as everything else, I
> just want the packets to be sent from a different $MAIL_INET_ALIAS IP
> (as opposed to the usual INET_IP

This makes perfect sense to me and is what I understood you to be wanting.  Now to just get the syntax correct so that it does work.

> However I think these are the sticking points:
> 
> ip route add table $IPROUTE2_SMTP_TABLE dev $INET_IFACE src $MAIL_INET_ALIAS
> ip route add table $IPROUTE2_SMTP_TABLE default via $INET_IP
> 
> I get 
> 
> $ ip route add table smtp.out dev eth0 src 217.154.55.250
> $ ip route add table smtp.out default via 217.154.55.241
> RTNETLINK answers: File exists

You may need to change your device entire in the above rule to be eth0:1 not eth0.  Some testing should tell you this for sure.

> .241 is my internet gateway router, not the default external IP of my
> firewall which is eth0=217.154.55.249. eth0:1=217.154.55.250 which is
> the $MAIL_INET_ALIAS
> 
> Combinations of either of the above mean the mail server cannot
> connect to an exteriror mail server.

Hmm, would it be possible for me to see the full output of your ip route tables and rules prior to what we have done here?  I'd also like to see the output of your iptables rules for the filter, nat, and mangle tables.  This way I can look at the entire picture and hopefully give you the correct info with out having to work with pieces of the information.



Grant. . . .



More information about the netfilter mailing list