Software >> OS >> Unix >> Solaris >> How to configure lan network interface for static IP

 

Solaris 10

e.g. for interface e1000g0
# rm /etc/dhcp.e1000g0    (delete dhcp file if it exist)
# ifconfig e1000g0 down
# ifconfig e1000g0 a.b.c.d netmask nnn.nnn.nnn.nnn
# ifconfig e1000g0 up
# vi /etc/hostname.e1000g0
<hostname-for-e1000g0>
# vi /etc/hosts
a.b.c.d   <hostname-for-e1000g0>
 

Solaris 9

create /etc/nodename containing hostname
eg. myserver
create /etc/hostname.<interfacename> containing the interface hostname
eg.  /etc/hostname.elxl0 containing myserver
create /etc/defaultrouter containing your default gateway
eg. 192.168.0.1
create /etc/resolv.conf containing your domain suffix, and primary and
secondary name servers
eg.
domain  somedomain.com
nameserver 1.2.3.4
nameserver 1.2.3.5
create /etc/inet/netmasks containing network number and netmask,
if the file is read only, set it writable first using chmod 644
eg
192.168.0.0    255.255.255.0
edit /etc/inet/ipnodes (and /etc/inet/hosts) and add the entry with your
desired static IP and hostname.
If the file is read only, set writable first using chmod
eg.
192.168.0.205    myserver
copy /etc/nsswitch.dns to /etc/nsswitch.conf
IMPORTANT:
ensure there is no file /etc/dhcp.<interface>