Additional ip address for mail

Operating system: Linux 5.4.0 on x86_64
OS version: Ubuntu 20.04.2

I just installed the latest Virtualmin on a fresh server and everything is working as it should.

The ISP provided two ip addresses on which one of them has ports open for sending/receiving mail from.

The Virtualmin server is using the default IP address right now. How would I set up the server to use the second IP address for all mail-related services?

tldr: I would like Postfix, phpmailer, etc to use a secondary IP for sending mail.

This is a weird configuration. You don’t need a second IP for mail.

But, you can configure Postfix to listen on a specific IP rather than all of them, using the inet_interfaces directive.

This will not control outgoing messages, however. But, it seems like this ServerFault answer has a solution that will work (I’ve never tried it, as it is a very unusual configuration):

Agreed but the ISP said the ports (25, 587, etc) are blocked on the default IP address and I have to use the other IP address for sending/receiving mail. Quite the inconvenience tbh.

That makes absolutely no sense at all. If they’re open on one then blocking them on the other does you absolutely no good.

Frankly, I’d find a new ISP.

So I ended up switching the server to use the mail ip as the default main ip from SolusVM.

I then changed the ip address for venet0:0 in Networking > Network Configuration > Network interfaces from the old ip to the new ip and then changed the old ip to the new ip in Addresses & Networking > Change IP Address as well.

I then rebooted the server for the changes to take effect.

But

https://OLD-IP:10000/ still works, and
https://NEW-IP:10000/ doesn’t work.

Is there anything else I have to change to make virtualmin use the new ip address?

No, I think you’re misunderstanding the problem. Virtualmin (Webmin) listens on all addresses by default. There’s probably a firewall blocking access, but not the local firewall on the system itself (unless the firewall on the system itself has some additional configuration beyond what Virtualmin sets up…the Virtualmin install just opens the ports it needs, it doesn’t try to figure out how to block anything).

The ISP ended up giving me a fresh IP address that I can use for both the web server and the mail server and everything is working fine now. Not really sure why they initially wanted me to use a separate ip for web and mail tbh but atleast everything is working fine now.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.