Setting up your networking in Solaris 10 and Nevada if you had dhcp running before

OK,
I get asked this all the time on IRC so here a small intro.
First you need to find out the interfacename. If you originaly set your configuration to dhcp,
there will be 2 files around, which you must delete for setting up static network:

/etc/dhcp.INTERFACENAME
and
/etc/dhcp/INTERFACENAME.dhc

note the INTERFACENAME, we will need that.

So, now that we know the name of the interface, lets start with the basics.

Insert the hostname you want your machine to have into the file:
/etc/nodename

Insert the same hostname and ip address into the file /etc/hosts
Insert the same hostname into the file /etc/hostname.INTERFACENAME

delete the dhcp files we found in the beginning.
Insert the network name and the netmask into /etc/inet/netmasks
Insert your default router ip address into /etc/defaultrouter
add your nameservers to /etc/resolv.conf
copy /etc/nsswitch.dhcp over /etc/nsswitch.conf

now that all files are prepared
do the following:

pkill dhcpagent
svcadm restart network/physical

now lets check with ifconfig -a if the right interface has the right address
with hostname if the host name was set correctly
and with netstat -r -n if you have the right routes setup

voila, its all there and will stay after reboot

Powered by ScribeFire.

Tags: , , ,

Leave a Reply

You must be logged in to post a comment.