Don't understand german? Read or subscribe to my english-only feed.

Solaris: Network Configuration

If you are new to Solaris one of the first things you might have to adjust is the network setup. If you are coming from the Linux-way-of-live the involved steps might be a bit uncommon for you. My description is refering to default Solaris EXCE (build 87) and OpenSolaris 2008.05 (build 86_rc3) systems. I’m describing the steps for a setup that persists across reboots, for on-the-fly temporary changes check out ifconfig(1M).

Since nevada build 62 Solaris provides a service named NWAM – the “Network Auto-Magic”. NWAM is running by default and tries to simplify network setup. To see whether it’s running just invoke ‘svcs svc:/network/physical’. If you want to go from auto-magic mode (being useful for example in a DHCP setup) to manual mode (if you need statically assigned addresses for example, that’s what we are talking about here) you have to disable the NWAM service. Disabling NWAM is BTW also necessary if you want to configure network via GNOME’s graphical network administration tool ‘network-admin’. To disable NWAM just execute:

% svcadm disable svc:/network/physical:nwam

See nwamd(1M) for more details about the nwam service. Now let’s continue with the relevant steps if you want to statically assign a persistent IP address.

This first important difference compared to Linux systems is the name of the network interface card (NIC). Whereas it’s something like eth0 and wlan0 by default on Linux, Solaris uses NIC names corresponding with the according driver (BSD users might know that already). So if you are using a PC-Net based card the device will be named pcn$ID, whereas your RealTek 8139 card will become rtls$ID.

Check which device(s) we have:
# ifconfig -a | grep index | awk -F: '!/^lo0/ { print $1}'

Check the hostname (or just execute 'hostname'):
# cat /etc/nodename

We define the NIC and the hostname as environment
variables for further configuration steps:
# INTERFACE='pcn0'
# HOSTNAME='solaris'

Configure DNS:
# cp -p /etc/nsswitch.dns /etc/nsswitch.conf
# cat >> /etc/resolv.conf << EOF
domain lan
nameserver $IP_OF_A_NAMESERVER

Configure hostnames and IP address (notice: /etc/inet/ipnodes and
/etc/hosts are symlinks to /etc/inet/hosts):
# perl -p -i -e 's/127\.0\.0\.1.*/       localhost loghost/' /etc/inet/hosts
# cat >> /etc/inet/hosts << EOF $HOSTNAME

# cat > /etc/defaultrouter << EOF

# cat > /etc/hostname.$INTERFACE << EOF

# cat >> /etc/netmasks << EOF  

Restart network and name services (just to make sure you don't use any old
caches) to apply changes on-the-fly (otherwise reboot):
# svcadm restart svc:/system/name-service-cache
# svcadm enable  svc:/network/physical:default
# svcadm restart svc:/network/physical:default

Well, that’s it. Problems?

Check link status:
# dladm show-dev
# dladm show-link

Check what hardware devices are present using scanpci:
# /usr/X11/bin/scanpci
pci bus 0x0000 cardnum 0x08 function 0x00: vendor 0x1022 device 0x2000
 Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]

and/or use prtconf(1M) (print system configuration), search for
"Ethernet" or "Network" inside the output:
# prtconf -v | less

Check the driver bindings that already exist on your
system for the network interface (format: 'driver "vendor-id,device-id"'):
# grep pcn /etc/driver_aliases
pcn "pci1022,2000"
pcn "pci103c,104c"

/etc/path_to_inst provides the mappings of
physical device names to instance numbers:
# grep pcn /etc/path_to_inst
"/pci@0,0/pci1022,2000@11" 0 "pcn"

Check name service resolution:
# getent hosts solaris   solaris

Use the update_drv(1M) command to update the driver configuration, the devfsadm(1M) command to rebuild the /dev device tree and to load the driver use the modload(1M) command.

For further details check out the official documentation: “System Administration Guide: IP Services” (PDF version).

Comments are closed.