Changing the IP address of a system running Solaris (Solaris 10, specifically) is different than a lot of other operating systems out there. Really, all you have to do is just edit a few files and then take the interface down and back up again. However, there seems to be a “gotcha†with Solaris 10. (I don’t know how far back this procedure goes—it is unclear to me if this is new to Solaris 10, or if it extends back to Solaris 8 or 9.)
Most of the sites out there I found indicated that you only needed to edit the /etc/hosts file (which is actually just a symlink to /etc/inet/hosts) and place the new IP address of the server in that file. Since I wasn’t changing the hostname or default gateway, there was no need to edit /etc/hostname.pcn0 (the hostname file for the only interface in the system), /etc/nodename, or /etc/defaultrouter. So I edited the /etc/inet/hosts file, rebooted the server, and expected to see the new IP address show up on the network.
It didn’t work. A bit more research indicates that in Solaris 10, the operating system uses /etc/inet/ipnodes over /etc/inet/hosts. This is a bit odd since ipnodes is only supposed to be used for IPv6, and I know that I specifically disabled IPv6 in this installation. Some additional targeted searches I performed, however, showed that this was indeed the case even if IPv6 is disabled.
Upon editing /etc/inet/ipnodes and rebooting the server, the IP address change took effect.
So, if you need to change the IP address of a server running Solaris 10, change the following files:
/etc/inet/hosts /etc/inet/ipnodes
Upon a reboot, the server will now have the new IP address.
(By the way, Solaris 10 U3 runs perfectly under ESX Server.)
Tags: Networking, Solaris, UNIX
-
Yes, ipnodes is now a link to the hosts file… However how do I tell solaris to use the first ethernet (the 10/100 port on the motherboard)? I set /etc/hosts. and saw that the ipnodes file was simply a link to hosts… but I am not seeing a working network connection. I have a second gigabit interface that I don’t plan to use yet… I’m assuming that the gigabit stole my ethernet config… short of removing the gigabit, how do I configure my solaris 10 machine in a deterministic manner? What is the “correct” configuration method?
There is a network configuration tool in the gui, and it seems to have more to do with “workgroup” type configuration, and nothing to do with ip configuration.
I think Sun is trying too hard to be different.
-
You also may have to change /etc/netmasks. It has the netmasks used for the ip addresses
-
Sorry, that should be /etc/inet/netmasks. It is sym linked back to /etc/netmasks. This file specifies the subnet mask to be used for a given IP address.
-
Good info, thanks!
I usually change it in these locations (some are sym links)
/etc/hosts
/etc/inet/ipnodes
/etc/hostname.{interfacename}Other areas for setting up networking that I use:
/etc/hosts –host info
/etc/nodename –host name info
/etc/netmasks –subnet info
/etc/defaultrouter –gw
/etc/defaultdomain
/etc/resolv.conf –dns info -
If you are not using IPv6, then I suggest you to remove the /etc/inet/opnodes contents to get rid of it, totally. Then it won’t bother you later on.




9 comments
Comments feed for this article
Trackback link: http://blog.scottlowe.org/2006/12/18/changing-the-ip-address-in-solaris-10-u3/trackback/