Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to config one SMTP server (sendmail) to send mail with 2 interfaces with different ip's depending server.

For example: In same machine with to ip: and i need to send email by and by

I don't now if i can configure it on sendmail, or use iptables, some idea ?


share|improve this question

migrated from Apr 9 '10 at 11:14

This question came from our site for professional and enthusiast programmers.

What is this requirement for? Sending mail offsite won't matter from the SMTP's point of view. Perhaps, can you explain what you are ultimately trying to accomplish? – Nathan Adams Apr 9 '10 at 12:30
up vote 0 down vote accepted

Most probably you want something different (sorry to tell you that). But if you really want to send mail over different interfaces/routes you have to have these two interfaces in two different networks, which should each have a router. Look at your OS' manpage for the route command, the /etc/hosts and /etc/networks files and possibly, how to setup your NICs. Set a static route for the non-default network. This non-default network must of course reach

share|improve this answer

I found some help about this, but not say nothing to send mails with diferents ip's or interfaces, using virtusertable.

share|improve this answer

You can find information on how to do this using exim at The option you're looking for is "interface"

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.