Change mail IP and close ports

richardev

Registered
Mar 23, 2017
2
0
1
Latvia
cPanel Access Level
Root Administrator
Hello.

I was wondering if and how it is possible to remove/disable/close specific ports on IP.

I have VPS running CentOS and the server has 2 IP's. 1st one is the main IP used by web server, ftp server & ssh. I changed mail server (Exim) IP address to 2nd IP. Currently if I scan my secondary IP it still shows all the ports together.

I would like to run all mail services on 2nd IP with ports (25,465,587, etc.) and all other services on 1st IP with ports (80,21,22,etc.). For example if we scan domain or IP ports the results would show only assigned ports for the specific IP address.

Is this even possible? And if it is - how can I do that?

Thanks in advance.