I need help from SOLARIS expert. Can someone please tell me how to change the IP address on SUN Solaris?
I have two NMS-SUN machines (Ultra 10) to manage our network with the following IP addresses and SM:
cwmws1: 10.10.100.2 255.255.255.0
cwmws2: 10.10.100.3 255.255.255.0
Due to our network migration, I need to change the IP address of each machine to the new assignment given below.
cwmws1: 10.10.51.100 255.255.255.0
cwmws2: 10.10.51.101 255.255.255.0
Hence, please send me the comprehensive procedure how I can achieve this.
Thanking you in advance.
If the host name of the machine remains this is quite simple.
On the Solaris machines you must modify the file /etc/hosts (every Solaris version) and on Solaris >= 10 the file /etc/inet/ipnodes.
Simply replace 10.10.100.2 by 10.10.100.100 and 10.10.100.3 by 10.10.100.101.
Then reboot the machine.
Type "/usr/sbin/ifconfig -a" just to verify that the change was successful.
I'm sorry for my late response. I am just wondering if it is necessary to change also the IP address of the ethernet interface (hme0) of each machine by using the command "ifconfig hme0 IP add netmask".
Thanks a lot.
The IP address of hme0 is indeed the IP address of the machine,
if it only has one interface.
When you run the reboot as suggested, the boot scripts assign the
interface a hostname from the contents of /etc/hostname.hme0, then
search for the IP address of that (ie, the current) host in /etc/hosts
You could run
# ifconfig hme0 <newIP> netmask <new netmask>
if you want, but the reboot will have that effect -- and you'll know
the config files are correct!
If you only run ifconfig but do not edit the hosts/ipnodes files, the
old IP address will reappear on reboot.
The IP address of the interface is taken from the file /etc/hostname.hme0.
Normally this file does not contain an IP address but a host name which will be looked up in /etc/hosts and /etc/inet/ipnodes.
(However a re-boot is required.)
You should take a look at /etc/hostname.hme0 anyway.
The "ifconfig" command can be used to temporarily change the host's IP address without re-booting. "Temporarily " means that the changes will be lost after re-booting the system.
I have successfully changed the IP address of my SUN machine by modifying the file /etc/hosts.
However, when I verified the IP address of hme0 using the ff command
it still shows the old IP and below is the last line of the screen capture
inet 10.10.100.2 ---> 22.214.171.124 netmask ffffff00
Upon knowing that the IP has not been changed, I run the command
#ifconfig hme0 inet <newIP> netmask <mask>
After that I rebooted the machine. However, when I verified the IP of interface hme0, it is still showing the old IP which is 10.10.100.2.
Please advise if this will have an effect on my machine and let me know what are the other ways to eliminate the old IP.
Thanks a lot.