How to change IP address permanently on Solaris 10
800808Apr 12 2012 — edited Apr 18 2012Hi Solaris Experts,
I would like to update an IP address permanently but believes ifconfig
only does it on the fly and will revert back once the Solaris 10 Sun Fire server
is rebooted:
( i ) # uname -a
SunOS angel 5.10 Generic_139556-08 i86pc i386 i86pc
( ii ) # ifconfig -a
bge0: flags=201000803<UP,BROADCAST,MULTICAST,IPv4,CoS> mtu 1500 index 2
inet 10.56.120.37 netmask fffffc00 broadcast 10.56.123.255
ether 0:1e:68:9b:30:33
nge0: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index 4
inet 203.20.160.62 netmask ffffff00 broadcast 203.20.160.255
ether 0:1e:68:9b:30:35
nge0:1: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index4
inet 203.20.160.81 netmask ffffff00 broadcast 203.20.160.255
nge1: flags=201000803<UP,BROADCAST,MULTICAST,IPv4,CoS> mtu 1500 index 5
inet 10.56.120.40 netmask fffffc00 broadcast 10.56.123.255
ether 0:1e:68:9b:30:36
( iii ) # vi /etc/inet/hosts (/etc/inet/ipnodes is softlinked to /etc/inet/hosts)
#10.56.120.37 angel angel.apple.com loghost
203.20.160.91 angel angel.apple.com loghost
( iv ) # svcadm restart network/physical
( v ) # ifconfig -a
bge0: flags=201000803<UP,BROADCAST,MULTICAST,IPv4,CoS> mtu 1500 index 2
inet 203.20.160.91 netmask ff000000 broadcast 203.255.255.255
ether 0:1e:68:9b:30:33
nge0: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index 4
inet 203.20.160.62 netmask ffffff00 broadcast 203.20.160.255
ether 0:1e:68:9b:30:35
nge0:1: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index4
inet 203.20.160.81 netmask ffffff00 broadcast 203.20.160.255
nge1: flags=201000803<UP,BROADCAST,MULTICAST,IPv4,CoS> mtu 1500 index 5
inet 10.56.120.40 netmask fffffc00 broadcast 10.56.123.255
ether 0:1e:68:9b:30:36
However, I want the correct netmask & broadcast are 255.255.255.0 & 203.20.160.255
respectively, the same as nge0: (203.20.160.62) & nge0:1 (203.20.160.81).
The following ifconfig command does update the IP address together with both correct netmask & broadcast
but don't believe that this change will stay after reboot:
#ifconfig bge0 inet 203.20.160.91 netmask 255.255.255.0 broadcast 192.168.1.255
The value in /etc/netmasks (softlinked to /etc/inet/netmasks) is:
10.56.120.0 255.255.252.0
The value in /etc/defaultrouter is:
203.20.160.1
In short, which other files also need to be updated to pickup the correct netmask (255.255.255.0)
& broadcast (203.20.160.255) permanently, without having to reboot the server?
Thanks in advance,
Jack