Difference between revisions of "HowTos/ChangeIP"

From Scalix Wiki
Jump to: navigation, search
(No difference)

Revision as of 20:16, 18 January 2007

Scalix Wiki -> How-Tos -> Change IP Address

There are multiple steps to correctly changing the IP Address of a Scalix 11 Server. In this example we will change the IP address from 192.168.1.100 to 192.168.1.50. The procedure for doing this will vary based on your linux distribution, the basic idea is to change the IP Address, then change the sources that resolve your IP and Hostname, and finally you change the Postgres Client Authentication to match the new IP Address (until a bug is fixed).


Update the /etc/hosts file

Edit the /etc/hosts file so that when your system attempts to reach itself or perform a lookup, it finds the new IP Address instead of the old one.


This is an example of the /etc/hosts file:

 # Do not remove the following line, or various programs
 # that require network functionality will fail.
 127.0.0.1               localhost.localdomain localhost
 192.168.1.100           mail.example.com mail

Edit the file to change the IP address in front of mail.example.com to be the new address like below:

 # Do not remove the following line, or various programs
 # that require network functionality will fail.
 127.0.0.1               localhost.localdomain localhost
 192.168.1.50            mail.example.com mail


Update the DNS Zones

Edit your DNS forward zone so that "host mail.example.com" (from a system other then the server) responds back with 192.168.1.50 instead of 192.168.1.100. Also edit your DNS PTR or reverse zones to match, so that "host 192.168.1.50" responds back with mail.example.com.


Update the Physical Address

Edit the /etc/sysconfig/network-scripts/ifcfg-eth0 file (may change based on your distribution) so that when the network or system restarts it brings up the new IP Address of 192.168.1.50.


This is an example of the ifcfg-eth0 file:

 DEVICE=eth0
 BOOTPROTO=static
 BROADCAST=192.168.1.255
 HWADDR=00:E0:81:33:EC:81
 IPADDR=192.168.1.100
 NETMASK=255.255.255.0
 NETWORK=192.168.1.0
 ONBOOT=yes
 TYPE=Ethernet

Edit the file to change the IPADDR= line to the correct IP Address. In this example the BROADCAST, NETMASK, and NETWORK can all remain the same, as we are not changing network ranges, just the IP in the current network:

 DEVICE=eth0
 BOOTPROTO=static
 BROADCAST=192.168.1.255
 HWADDR=00:E0:81:33:EC:81
 IPADDR=192.168.1.50
 NETMASK=255.255.255.0
 NETWORK=192.168.1.0
 ONBOOT=yes
 TYPE=Ethernet


Update the Postgres Client Authentication

Currently Scalix 11 has a bug (http://bugzilla.scalix.com/show_bug.cgi?id=14487) where Postgres does not get updated and access to the Scalix API is denied. To rectify this you need to modify the file /var/opt/scalix/NN/postgres/data/pg_hba.conf. Remember NN is the abreviation of your Scalix node, so it will change depending on the hostname of your scalix server.

Find the line that looks like:

 host    scalix      scalix      192.168.1.100/32   md5

Edit the file tto change this line to look like the one below:

 host    scalix      scalix      192.168.1.50/32   md5


Reboot and enjoy your server

After you have finished this procedure please reboot. Everything should be working just like before.

Do remember, however, that this discussion only covered Scalix. Other services or other parts of the server which depend on the IP Address instead of hostname will still need to be changed.