Solaris_logo

There are two methods to change the IP address in SUN Solaris server.

1) Temporary Method

As the name shows, the temporary method changes the IP address of the machine only till the time it is running continuously. As soon as, the server is restarted, the IP address is reverted back to the one configured before. You can use this method simply by inputting the following command on Solaris server.

ifconfig <interface> <ip address> netmask <subnet mask>


Example:

image 

2) Permanent Method

The permanent method involves the modification the following files. After modification, restart of machine is required.

i) /etc/hosts        ii) /etc/netmasks        iiii) /etc/inet/ipnodes

First two files have to be modified in all the Solaris versions while the third file is present in Solaris 9 or above. The ‘hosts’ file looks like the following. You’ll have to modify the addresses as per requirement and then save the settings.

image

Check an example of  ‘netmasks’ file as follows. Please note that the ip address segment is the same as the segment of the ip addresses mentioned in ‘hosts’ file.

image

‘#’ in the above file represents the commented lines and are ignored by the complier. For the last file i-e ‘ipnodes’, the modification is required if the local ip address mentioned in the file is other than 127.0.0.1. However, if the ip address is local loop back address (127.0.0.1), no modification is required. The file looks like the one shown below:

image

‘::1’ is the representation of loopback address in IPv6 which the second entry belongs to IPv4.

Adnan Khurshid

Adnan Khurshid, the author of this article, has been working in a telecommunication sector since 2007. He has worked there as a VAS (Value Added Services) engineer and has excelled remarkably in the field. Working in this field has been his passion and he has always made efforts to keep himself up to date. Find more about him on LinkedIn

More Posts

Tags: , , , , , ,

Leave a Reply