How To: Change IP Address in Solaris 10 without reboot

How To: Change IP Address in Solaris 10 without reboot

Adding or editing the IP address on a Solaris 10 server is different from the previous versions of
the OS (Solaris 9, Solaris 8 etc).

In the previous versions of the Solaris Operating System, you need to edit the /etc/hosts file
and add/edit the entry for the IP address and the hostname.

Example:

192.168.1.1 sun1

However, in Solaris 10, you should edit the /etc/hosts file (a symlink to /etc/inet/hosts file) and
the /etc/inet/ipnodes file and add an entry for IP address and hostname.

Once done, restart the Network service using

# svcadm restart network/physical

or reboot the server for the changes to take effect.

Although, the /etc/inet/ipnodes files is primarily for IPv6 only, without adding an entry
to the file, the IP address (IPv4) doesn't become active. This seems to be a known problem
but the good news is this is now fixed in the Solaris 10 U4 (08/07 build).

Also, ensure that the /etc/netmasks file with the network ID and the netmask.

Or you can change it on the fly by running this command:
#ifconfig xl0 inet 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255

UPDATE: It seems that Solaris 10 now checks the /etc/inet/ipnodes file first before the /etc/hosts file to set the IP. So, if the IP is currently set in /etc/inet/ipnodes, you will have to change it there as well.

  • IP -> /etc/hosts
  • Netmask -> /etc/netmasks
  • Gateway -> /etc/defaultrouter
  • IP (again) -> /etc/inet/ipnodes (This is new in Solaris 10)
  • DNS Servers -> /etc/resolv.conf
And that's that! You now have your IP information set.

0 comments: