Sunday, April 13, 2008

SXCE and Basic Networking.

For this instalment we are going to look into basic network knowledge in Solaris.
There are two ways to configure networking in Solaris, the first of which is a tool known as Network Auto-Magic or nwam(1).
By running:

$svcs -x network/physical:nwam

Provides the status if nwam is online or not, Network Auto-Magic is a project to simplify and automate network configuration on Solaris. Basically autoconfigures your NIC from your local DHCP/DNS server.

However, It is some times necessary configure a static IP or provide DNS infomation manually. To to manually configure networking in Solaris one must disable this service in favour of the default by doing the following:

$su
_root-password_
#/bin/zsh
#svcadm enable network/physical:default

Things you should keep at hand are:
* IP Address of the System
* Hostname
* Subnet Files: /etc/netmasks
* Default gateway
* DNS Server list. Files: /etc/nsswitch.conf *and* /etc/resolv.conf

Then you can configure each of the above as follows:

Static:

* IP Address (192.168.1.3) and Hostname (solarisrox)
#echo '192.168.1.3 solarisrox' >> /etc/hosts; echo 'solarisrox' > /etc/hostname.hme0"

N.B. Assuming that hme0 was the interface you wanted to use.
Hint: Can be found with ifconfig -a
*Default gateway (192.168.1.1)
#echo 10.0.0.255 > /etc/defaultrouter

DHCP:

#echo "" > /etc/hostname.hme0 > /etc/dhcp.hme0 > /etc/defaultrouter
#echo "wait 15" >> /etc/dhcp.hme0

DNS:

First check /etc/nsswitch.conf for the line "hosts: dns files" is ok.
Then inside /etc/resolv.conf check to make sure it looks something like this:

search myisp.com
nameserver 1.2.3.4
nameserver 5.6.7.8

After all your configuration you can simply restart the network service as follows:

#svcadm restart network/physical:default

Comments are always welcome..

Regards,
Edward.

No comments: