The Cavitand Site
Free Resources for a Free Internet
Home -> Documentation Projects | Tools | Docs | About

How To Configure Network Interfaces in Solaris


Background

After the original installation of Solaris, you decide to change/add/remove interfaces from your system.

Solution

  1. Stop the Interface

    This is the first thing to do if you are to change/delete an interface. If you are to create one, skip this step.

    
    # ifconfig <interface> down
    

    This command will stop the interface. For example,

    
    # ifconfig qfe0 down
    

    will stop your qfe0 interface.

  2. Unplumb the interface

    Follow this step only if you are to remove the interface.

    Simply issue a:

    
    # ifconfig <interface> unplumb
    

    to remove the interface completely.

  3. Plumb the interface

    To create a new interface, first you have to plumb it:

    
    # ifconfig <interface> plumb
    
    

    For your qfe1 interface,

    
    
    # ifconfig qfe1 plumb
    

  4. Configure the interface

    Several options can be set/unset when you configure an interface. By far, the most used command syntax is as follow:

    
    
    # ifconfig <interface> <ip_address> netmask <netmask>
    

    For example, to set interface qfe1 to use an IP address of 10.3.234.25 and a netmask of 255.0.0.0, write:

    
    
    # ifconfig qfe1 10.3.234.25 netmask 255.0.0.0
    

  5. Start the interface

    This command will start the interface so that it can begin sending/receiving data:

    
    
    # ifconfig <interface> up
    

    Following our example, start qfe1 by issuing:

    
    # ifconfig qfe1 up
    

    Tip: You can combine the last two steps:

    
    
    # ifconfig qfe1 10.3.234.25 netmask 255.0.0.0 up
    

Note the method instructed above is NOT permanent: changes will be lost after reboot. The following Mini-How-To will address that configuration change.

  1. Edit the /etc/hosts file

    Edit the /etc/hosts file and include an entry for each interface yo want to configure. Give it a different name. For example, to configure hme0 and qfe0, include:

    
    my_machine	10.1.235.34
    my_machine_qfe0 10.1.235.88
    

    There are no restrictions regarding the belonging to different networks.

  2. Edit the /etc/hostname.<interface> files

    For each interface you want to change permanently, you have to include the name (as is the /etc/hosts file) of the interface:

    
    # cat /etc/hostname.hme0
    my_machine
    
    # cat /etc/hostname.qfe0
    my_machine_qfe0
    

    The next time the machine reboots it will take your changes


    cavitand.com 2002
    Contact WebMaster
    All rights reserved