Re: postfix interface
- 2008/8/1 Gabriel Angel Möll Ibacache <gabriel.moll@...>:
> Well, I tryed to define smtp_bind_address=y.y.y.y but that didn'tYou need to make sure you understand the difference between binding to
> work, maybe because I had the same default router for both IP (x.x.x.x
> and y.y.y.y). Or maybe the nat rule in iptables is causing the
> redirection to x.x.x.x.
the source-IP and getting the packets routed out. With
smtp_bind_address, packets will be created with that source address.
Past this point, it's up to the networking stack to figure out which
physical interface it leaves by.
SNAT is a post-routing rule. This means it does something only once
all the routing is done, the outgoing interface has already been
Linux only does destination-based routing (by default). To make the
packets leave via eth2, make sure that eth2 is the default gateway.
You can check this with something like:
yoshino:~# ip route get to 220.127.116.11
18.104.22.168 via 22.214.171.124 dev eth1 src 126.96.36.199
cache mtu 1500 advmss 1460 hoplimit 64
If you don't see the correct device there, you probably need to fix the routing.