In a Debian server, I added a second IP by the following configuration in /etc/network/interfaces
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 1.1.1.1
netmask 255.255.255.255
gateway 1.1.1.1
auto eth0:1
iface eth0:1 inet static
address 1.1.1.2
netmask 255.255.255.255
Now, postfix
sends emails with the second IP instead of the primary IP.
I use a dedicated IP for each domain managed by nginx
. Is it possible to send email from each domain by the IP dedicated to that domain?
If NOT, how to use the primary IP for sending emails?
ip route change default via <your gateway> src <your prefered source address>
.