Welcome to Machine Unix

Search Below

Changing the IP address of a Solaris 10 host without a reboot

It is possible to change the IP address of a solaris 10 host by modifying couple of files.  Here is how:

The ip address of the system is placed under /etc/hosts. This file actually is symbolically linked to /etc/inet/hosts in Solaris 10. In my system, I have the following in my /etc/hosts

# cat /etc/hosts

::1     localhost       localhost   opensolaris     loghost

So I am going to change IP address from to Edit the /etc/hosts file with a text editor of your liking:

#vi /etc/hosts

::1     localhost       localhost   opensolaris     loghost

Since this file is sym linked to /etc/inet/hosts, you should be able to see the change:

# cat /etc/inet/hosts

::1     localhost       localhost   opensolaris     loghost

At this point you should also change the IP address in /etc/inet/ipnodes .

Now use ifconfig command to make the change effect immediately.

# ifconfig pcn0 netmask

# ifconfig -a

lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1

inet netmask ff000000

pcn0: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index 2

inet netmask ffffff00 broadcast

If you want to have changes take effect across reboots, you can restart the network/physical service:

# svcadm restart network/physical

That’s it…Now you’ve changed the actual IP address without even rebooting….