Changing Hostnames/ IP addresses
Change IP Address
Standalone TUXGUARD Mail Gateway Server
It is not necessary to change to the TUXGUARD Mail Gateway configuration to change the IP address of a standalone TUXGUARD Mail Gateway server. Simple change the IP address of the standalone server and restart the TUXGUARD Mail Gateway services:
systemctl restart tuxmail-web
systemctl restart haraka
Master node
Shutdown the services on the Master and all of the Slaves:
systemctl stop tuxmail-web (master only)
systemctl stop haraka
Change the IP address of the Master:
nmcli con mod <device> ipv4.addresses "ip.ip.ip.ip"
systemctl restart network
On each slave, edit /etc/tuxmail/env and change the IP address for each of the following variables to reflect the new IP address of the Master node:
DSPAM_HOST=ip.ip.ip.ip
TUX_DB_HOST=ip.ip.ip.ip
TUX_ES_HOST=ip.ip.ip.ip
TUX_REDIS_HOST=ip.ip.ip.ip
Edit /var/lib/pgsql/9.4/data/recovery.conf and change the host=ip.ip.ip.ip to reflect the new IP address of the Master node, then restart the PostgreSQL server on each worker/slave with systemctl restart postgresql-9.4
Finally restart the services on the Master and Slaves:
systemctl start tuxmail-web (master only)
systemctl start haraka
Worker/Slave node
On the Worker/Slave node that is changing IP address, shutdown the following services:
systemctl stop haraka
systemctl stop postgresql-9.4
On the Master node, run the following commands:
firewall-cmd --zone=tux_cluster_nodes --remove-source=old.ip.ip.ip
firewall-cmd --zone=tux_cluster_nodes --remove-source=old.ip.ip.ip --permanent
firewall-cmd --zone=tux_cluster_nodes --add-source=new.ip.ip.ip
firewall-cmd --zone=tux_cluster_nodes --add-source=new.ip.ip.ip --permanent
Change the IP address on the Worker/Slave node:
nmcli con mod <device> ipv4.addresses "ip.ip.ip.ip"
systemctl restart network
Check the “Shared Cache” settings in the TUXGUARD Mail Gateway Web UI and modify them as necessary.
If the Worker nodes are on separate subnets, then you will need to specify the IP addresses of each Worker node for cache sharing to function properly, however if they are on the same subnet, then Multicast can be used and this will work without modification.
Then restart the services:
systemctl start postgresql-9.4
systemctl start haraka
Changing the Hostname
Changing the hostname of a Master node is not recommended unless the system has not been in production.
This is because on a TUXGUARD Mail Gateway installation, you must access the web interface using the Master node hostname to be able to log-in to the web interface as an administrator.
Accessing the Master node using any other hostname will cause it to presume that you want to log-in to TUXGUARD Mail Gateway as a user of a domain that is handled by TUXGUARD Mail Gateway and therefore trying to log-in as an Admin will fail.
If the hostname of the Master is changed, then you will need to restart the following services once the hostname has been changed:
hostnamectl set-hostname <new-hostname>
systemctl restart tuxmail-web
systemctl restart haraka (if the Master is also an SMTP Worker)
You can change the hostname of a Worker/Slave node, however this will cause the following issues:
- The “Cluster” page on the will show the old hostnames as offline for the following 24 hours.
- The “Cluster” page graphs will show the old hostnames separately to the new hostnames and will not disappear from the graph for 7 days.
- The click URLs generated by the node (if Click Whitelisting is enabled) will reference the old hostname and will not work unless the old hostname is pointed to the new hostname by use of a CNAME. The old hostnames might still be accessed for up to 40 days after it is changed.
- View/Release of quarantined items will not work unless the old hostname is pointed to the new hostname by use of a CNAME. Old hostnames might still be referenced for up to 60 days after the name is changed depending on the log retention configured.
- The PostgreSQL replication will still use the old hostname for its replication slot, this will not cause any issues unless you reuse the same hostname on a different node.
Once the hostname is changed on a Worker/Slave node, the following services should be restarted:
hostnamectl set-hostname <new-hostname>
systemctl restart haraka