How to Change IP Address in Unix System

Last Updated: February 24, 2007

Issue

How to Change IP Address in Unix?

Solution

Answer 1

By far the cleanest way of doing this is by running usr/sbin/sys-unconfig

This will let you re-enter all those install type questions: hostname, IP address, nameservices etc,etc. This will also require a reboot.

Answer 2

You can change the IP address of your UNIX server with the following command:

#ifconfig lo0:0 inet <ip-address> netmask<subnetmask> broadcast<broadcast addr> down

#ifconfig le0 up

Answer 3

You need to make changes in three files:

  • /etc/hosts (For new IP address of server)
  • /etc/defaultrouter (For new router IP address)
  • /etc/netmasks (For new N/W number)