Wednesday 16 April 2008

How to Change the IPv4 Address and Other Network Configuration Parameters (Solaris)

Modifying the IPv4 Address and Other Network Parameters to Persist Across Reboots

This example shows how to change the following network parameters of a system that is moved to another subnet:
IP address for the primary network interface eri0 changes from 192.168.7.11 to 192.168.8.12
Host name changes from RFATEST11 to RFATEST12
Netmask changes from 255.255.255192 to 255.255.255.0
Default router address changes to 192.168.8.254

Check the system's current status:

# hostname
RFATEST11
# ifconfig -a
lo0: flags=1000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
eri0: flags=1000843 mtu 1500 index 2
inet 192.168.7.11 netmask ffffffc0 broadcast 192.168.7.63
ether 8:0:20:c1:8b:c3

Next, change the system's host name and the IP address of eri0 in the appropriate files:

# vi /etc/nodename
RFATEST12

In Solaris 10 11/06 and earlier Solaris 10 releases

# vi /etc/inet/ipnodes
192.168.8.12 RFATEST12 #moved system to 192.168.8 net
# vi /etc/inet/hosts
#
# Internet host table
#
127.0.0.1 localhost
192.168.8.12 RFATEST12 loghost
# vi /etc/hostname.eri0
192.168.8.12netmask + 255.255.255.0

Finally, change the netmask and the IP address of the default router.

# vi /etc/netmasks.
.
.
192.168.8.0 255.255.255.0
# vi /etc/defaultrouter
192.168.8.254 #moved system to 192.168.8 net#

After making these changes, reboot the system.

# reboot -- -r
V
erify that the configuration you just set is maintained after the reboot:

# hostname
RFATEST12
# ifconfig -a

lo0: flags=1000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
eri0: flags=1000843 mtu 1500 index 2
inet 192.168.8.12 netmask ffffff00 broadcast 192.168.8.255
ether 8:0:20:c1:8b:c3

reference : http://docs.sun.com/app/docs/doc/816-4554/gbwxb?a=view
script : http://www.sun.com/bigadmin/jsp/descFile.jsp?url=descAll/change_iphostname&cid=e5595

No comments: