How to Change the IP Address in a Carbonio Community Edition Server | Carbonio CE

One of the key system requirements when installing Carbonio Community Edition (CE) is to have a static IP address that does not change over time. A good recommendation is to have two network interfaces on the server, one of which provides access to the web client and other Carbonio services from the external Internet, and the other is static and is used for access from the local network. All these recommendations appeared for the reason that if the IP address of the Carbonio server unexpectedly changes, it will work and start correctly. In this article, we will talk about what actions should be taken if Carbonio’s IP address is changed to restore the server’s functionality and the associated services.

If Carbonio and all services are installed on the same server, eliminating the consequences of changing the IP address is a trivial task.

1. Change the appropriate entry in /etc/hosts

Carbonio does not start correctly precisely because the hostname in the /etc/hosts file corresponds to the old IP address. For example, after changing the IP address from 1.2.3.4 to 4.3.2.1, you need to change the entry in /etc/hosts

2. Change the MTA’s list of trusted addresses

By default, the list of trusted servers looks like this:

zimbraMtaMyNetworks: 127.0.0.0/8 [::1]/128 1.2.3.0/24

Our task is to bring it to 127.0.0.0/8 [::1]/128 4.3.2.0/24

This is done using the command

carbonio prov ms mail.carbonio.local zimbraMtaMyNetworks '127.0.0.0/8 [::1]/128 4.3.2.0/24'

3. Change the address in the nginx settings

Go to the /opt/zextras/conf/nginx/includes folder and edit the nginx.conf.zmlookup file located there. The string it contains

zm_lookup_handlers https://1.2.3.4:7072/service/extension/nginx-lookup;

It should be reduced to the following form:

4. Change the Carbonio Mesh binding address

Carbonio Mesh, a system that ensures the connectivity of the mail server with other services, is also tied to an IP address during initial setup. After the change, you need to change it in the settings.

Open the file /etc/zextras/service-discover/config.json and edit the binding address specified there

5. Reconfigure the video server

Reconfigure the video server node

If you added a video server not by hostname, but by IP address, you will need to delete the old entry about it and then add a new one.

To obtain the password from the video server VIDEOSERVER_PWD, run the command grep -i -e nat_1_1 -e api_secret /etc/janus/janus.jcfg

To change the public address of the video server, open the file /etc/janus/janus.jcfg and write the new IP address in the nat_1_1_mapping line

After these steps, you will need to restart the Carbonio server.

The process of restoring functionality largely depends on how many servers’ IP addresses have changed, as well as on how exactly the network visibility of the servers is ensured.

1. Change the appropriate entry in /etc/hosts

Following the example of point 1 in the previous section of the instructions, change the local entry for the name of each server whose IP address has changed in the /etc/hosts file.

In Carbonio, nodes communicate with each other using domain names, and a common practice is to write server names not in the local DNS, but in the /etc/hosts file. If the server names are registered in DNS, it is enough to simply update their records; if the server names are registered in /etc/hosts, you will need to make changes to them on each of the servers.

2. Check your local configuration for an IP address

In some cases, especially if there are several LDAP servers in the infrastructure, access to them can be configured not by domain name, but by IP address. You can check this in the /opt/zextras/conf/localconfig.xml file in the ldap_master_url and ldap_url fields.

3. Change the MTA’s list of trusted addresses

This action should only be performed on the MTA node and only if the IP address has changed significantly. The procedure for changing trusted addresses completely repeats the steps from paragraph 2 of the previous section of the instructions.

4. Reconfigure Carbonio Preview

If the Proxy node address has changed, you will need to change the settings of the Carbonio Preview service, which accesses the Memcached module located on the proxy exactly by IP address.

To do this, open the /etc/carbonio/preview/config.ini file and make changes to the Carbonio Preview settings.

nginx_lookup_server_full_path_urls = https://New_AppServer_IP:7072
memcached_server_full_path_urls = New_Proxy_IP:11211

Replace New_Proxy_IP with the new Proxy server address if it has changed. Replace New_Appserver_IP with the new Appserver server address if it has changed.

If your infrastructure has several Proxy and/or AppServer servers, specify their IP addresses separated by commas. Eg:

nginx_lookup_server_full_path_urls = https://New_AppServer1_IP:7072,https://New_AppServer2_IP:7072
memcached_server_full_path_urls = New_Proxy1_IP:11211,New_Proxy2_IP:11211

5. Reconfigure Nginx 

If you change the IP address of the Proxy node, go to it and go to the /opt/zextras/conf/nginx/includes folder. Open the nginx.conf.zmlookup file and in the zm_lookup_handlers line, change the IP address specified there to a new one.

6. Reconfigure video server node

If you added a video server to the infrastructure by IP address, you should first delete the old entry and then add a new one.

To obtain the password from the video server VIDEOSERVER_PWD on the node with it, run the command grep -i -e nat_1_1 -e api_secret /etc/janus/janus.jcfg

To change the public address of the video server, open the /etc/janus/janus.jcfg file on the node with it and write the new IP address in the nat_1_1_mapping line.

7. Re-configuring Carbonio Mesh

Carbonio Mesh consists of server and agent nodes. Their reconfiguration occurs in different ways.

If you change the IP address of the Carbonio Mesh server node, just open the /etc/zextras/service-discover/config.json file on it and edit the binding address specified there.

If the IP address of the agent node is changed, you will need to remove it from the cluster using the consul force-leave Old_agent_IP command executed on the Carbonio Mesh server node. Instead of Old_agent_IP, enter the address that the agent node had before the IP change.

After this, add the node again by executing the command consul join New_agent_IP on the server node, replacing New_agent_IP with the current IP address of the agent node.

After completing all these steps, perform a hard reboot of all Carbonio infrastructure nodes.

Thanks to the described actions, you can quickly restore the full functionality of the Carbonio infrastructure in the event of a change in the IP addresses of all or part of its servers.

Post your comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

10 Minutes Migration: Zimbra OSE To Carbonio Migration in a Nutshell | Carbonio CE
Setting Up Email Interception in Carbonio Community Edition | Carbonio CE