Solaris, Solaris Express, OpenSolaris
1.  Many users coming from the BSD or GNU/Linux communities are 
confounded by the apparent difficulty of configuring network connections on 
Solaris.  Although many system administrators recognize the superior 
characteristics of Solaris operating system, such as BrandZ containers, 
DTrace, ZFS, Zones, SMF, and the like, those features are useless to a 
newcomer if simple networking cannot be easily configured.

2.  This guide will give a novice Solaris system administrator step by step 
instructions to configuring a network connection on Solaris.  I am not 
familiar with the procedure for versions of Solaris prior to version 10. 
This procedure will work on the commercial version of Solaris 10, Solaris 
Express Community Edition, Solaris Express Developer Edition, and 
OpenSolaris.

3.  In recent builds of the Solaris operating system, Nevada build 62 or 
greater, there are two methods to configure the network interface.  The new
method is called Network Auto-Magic (NWAM).  This guide will show both 
methods of configuring the network.  If you are running a version of Solaris 
which does not support NWAM, you will have to use the first procedure.  If 
you are running a version of Solaris which supports NWAM, you may choose 
either method you are comfortable with.  They both can negotiate both DHCP 
and static IP address allocations.

4.  First verify that the system recognizes the desired network card.  Type the 
following from any user command shell:

    # ifconfig -a

    a.  If your network card drivers are installed, then you will see an output
similar to the following:

nge0:  flags=201000842<BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index 2
        inet 0.0.0.0 netmask 0
        ether 0:c:29:27:63:5f

    b.  If the output only shows a network device with the name [lo0], then you 
will need to install the appropriate drivers.  Network card driver installation 
will not be covered by this guide.  I intend to cover that in a future guide.

5.  CONFIGURATION USING DEFAULT METHOD

    a.  In Solaris 10, network connections are maintained by the same 
System Management Facility (SMF) that manages most system 
daemons.  Although understanding SMF is not a prerequisite for 
configuring a network connection, I highly recommend reading 
about it some time in the future.

    b.  Solaris 10 introduced the following Fault Managed Resource 
Identifier (FMRI) for network configuration:
svc:/network/physical:default.  Enabling this FMRI will cause the system 
to configure the network connection using the traditional Solaris 
network configuration files as shown in the following table.

File    Purpose         Example Contents
/etc/hostname.nge0      Computer system hostname.       aluminum
/etc/dhcp.nge0  Flag specifying whether to use DHCP.    (No contents. Its 
presence tells Solaris to use DHCP. Without this file, a static IP address will 
be used, by looking up the hostname as found in the [/etc/hostname.nge0] file 
in the [/etc/inet/hosts] file.)
/etc/inet/hosts         List IPv4 IP addresses.         127.0.0.1 loghost
10.0.0.3 aluminum aluminum.americanbackupsolutions.com
/etc/defaultrouter      Lists the IP address of the default gateway.    10.0.0.1

    c.  To configure Solaris to use a DHCP address, type the following from the
superuser shell, replacing the network device name with the name of the
interface on the system:

        # rm /etc/hostname.nge0 /etc/dhcp.nge0
        # echo "aluminum"> /etc/hostname.nge0
        # touch /etc/dhcp.nge0

    d.  To configure Solaris to use a static IP address, type the following 
from the
superuser shell, replacing the network device name with the name of the
interface on the system.  Also be sure to use the correct network identifier 
and netmask on the last line:

        # rm /etc/hostname.nge0 /etc/dhcp.nge0
        # echo "aluminum"> /etc/hostname.nge0
        # cp /etc/inet/hosts /etc/inet/hosts.orig
        # echo "127.0.0.1 loghost"> /etc/inet/hosts
        # echo "10.0.0.3 aluminum aluminum.americanbackupsolutions.com">> 
/etc/inet/hosts
        # echo "10.0.0.0 255.0.0.0">> /etc/inet/netmasks

    e.  I have to use a special file because the nge network driver for 
OpenSolaris does not take into account the fact that the NIC's chipset has 
a flaw.  See reference link number (1).

        # echo "aluminum ether 0:1a:92:44:4c:d5"> /etc/hostname.nge0

    f.  Configure the default gateway as follows:

        # echo "10.0.0.1"> /etc/defaultrouter

    g.  After the network interface files have been configured, bring up the
network as follows.  The NWAM service may have to be disabled first.

        # svcadm disable svc:/network/physical:nwam
        # svcadm enable svc:/network/physical:default

6.  CONFIGURATION USING NWAM

    a.  As discussed earlier, in Nevada build 62 or greater, Sun engineers 
introduced a new method of configuring the network connection.  NWAM is 
designed to allow dynamic connection and disconnection of various network 
devices, taking advantage of SMF to bring up or tear down network connections 
as required.  The motivation for this new design was to allow mobile computer 
users to take advantage of various wireless and wired networks without having 
to 
perform a system reboot or drop into the command shell each time a network 
change was required.  The FMRI for NWAM is svc:/network/physical:nwam.  See
reference line number (2).

    b.  To configure Solaris to use a DHCP address, type the following from the
superuser shell, replacing the network device name with the name of the
interface on the system.  Note that the filename below has two lowercase letter 
Ls followed by a lowercase letter P:

        # echo "nge0 dhcp"> /etc/nwam/llp

    c.  To configure Solaris to use a static IP address, type the following 
from the
superuser shell, replacing the network device name with the name of the
interface on the system, and replacing the IP address and network bit mask 
with the desired set for your system.  Note that the filename below has two 
lowercase letter Ls followed by a lowercase letter P:

        # echo "nge0 static 10.0.0.3/8"> /etc/nwam/llp

    d.  You may place several lines in the [/etc/nmam/llp] file, each
specifying the parameters for the network connection using various devices.  
The order of appearance of the interface names specifies the relative preference
for each device.

    e.  After the network interface files have been configured, bring up the
network as follows.  The old default service may have to be disabled first.

        # svcadm disable svc:/network/physical:default
        # svcadm enable svc:/network/physical:nwam

7.  CONFIGURING HOSTNAME LOOKUP WITH DNS.  To configure the DNS client to 
attempt to resolve hostnames via DNS:

        # svcadm disable svc:/network/dns/client:default
        # echo "domain americanbackupsolutions.com"> /etc/resolv.conf
        # echo "search americanbackupsolutions.com">> /etc/resolv.conf
        # echo "nameserver 10.0.0.1">> /etc/resolv.conf
        # cp /etc/nsswitch.dns /etc/nsswitch.conf
        # svcadm enable svc:/network/dns/client:default

8.  The computer's Internet connection should be fully functional, even 
without a reboot.  Test networking by a simple ping test.  Note that some 
firewalls and web servers do not respond to ICMP packets.  If a ping test 
does not work, test your connection by visiting a website.

        # ping www.google.com

9.  Give the system a reboot to test its ability to automatically reconnect 
upon startup:

        # shutdown -y -g 0 -i 6

References:

(1) http://www.opensolaris.org/jive/thread.jspa?threadID=47551&tstart=120

(2) 
http://opensolaris.org/os/project/caiman/Slim_Install/project_documents/slim_install_getstarted/slim_install_GetStarted_nwam/

Karrick McDermott
 
 
This message posted from opensolaris.org
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to