System Administration Guide: IP Services

ProcedureHow to Configure a Physical Interface After System Installation

Use the next procedure for configuring interfaces. If you are using the Solaris 10 3/05 release, use the procedure How to Add a Physical Interface After Installation in Solaris 10 3/05 ONLY.

Before You Begin
  1. On the system with the interfaces to be configured, assume the Primary Administrator role or become superuser.

    The Primary Administrator role includes the Primary Administrator profile. To create the role and assign the role to a user, see Chapter 2, Working With the Solaris Management Console (Tasks), in System Administration Guide: Basic Administration.

  2. Determine which interfaces are currently installed on the system.

    # dladm show-link
  3. Configure and plumb each interface.

    # ifconfig interface plumb up

    For example, for qfe0 you would type:

    # ifconfig qfe0 plumb up

    Note –

    Interfaces that are explicitly configured with the ifconfig command do not persist across a reboot.

  4. Assign an IPv4 address and netmask to the interface.

    # ifconfig interface IPv4-address netmask+netmask

    For example, for qfe0 you would type:

    # ifconfig
    qfe0 netmask +

    Note –

    You can specify an IPv4 address in either traditional IPv4 notation or CIDR notation.

  5. Verify that the newly configured interfaces are plumbed and configured, or “UP.”

    # ifconfig

    Check the status line for each interface that is displayed. Ensure that the output contains an UP flag on the status line, for example:

    qfe0: flags=1000843 <UP,BROADCAST,RUNNING,MULTICAST,IPv4>
    mtu 1500 index 2
  6. (Optional) To make the interface configuration persist across reboots, perform the following steps:

    1. Create an /etc/hostname.interface file for each interface to be configured.

      For example, to add a qfe0 interface, you would create the following file:

      # vi /etc/hostname.qfe0

      Note –

      If you create alternate hostname files for the same interface, the alternate files must also follow the naming format hostname.[0–9]*, such as hostname.qfe0.a123. Names such as hostname.qfe0.bak or hostname.qfe0.old are invalid and will be ignored by scripts during system boot.

      Note, too, that a given interface must have only one corresponding hostname file. If you create an alternate hostname file for an interface with a valid filename, such as /etc/hostname.qfe and /etc/hostname.qfe.a123, the boot scripts will attempt to configure by referencing the contents of both hostname files and would therefore generate errors. To prevent these errors, provide an invalid file name to the hostname file that you do not want to use in a given configuration.

    2. Edit the /etc/hostname.interface file.

      At a minimum, add the IPv4 address of the interface to the file. You can use traditional IPv4 notation or CIDR notation to specify the IP address of the interface. You can also add a netmask and other configuration information to the file.

      Note –

      To add an IPv6 address to an interface, refer to Modifying an IPv6 Interface Configuration for Hosts and Servers

    3. For Solaris 10 11/06 and earlier releases of Oracle Solaris 10, add entries for the new interfaces into the /etc/inet/ipnodes file.

    4. Add entries for the new interfaces into the /etc/inet/hosts file.

    5. Perform a reconfiguration boot.

      # reboot -- -r
    6. Verify that the interface you created in the /etc/hostname.interface file has been configured.

      # ifconfig -a

      For examples, refer to Example 6–2.

Example 6–2 Adding Persistent Interface Configurations

The example shows how to configure the interfaces qfe0 and qfe1 to a host. These interfaces remain persistent across reboots.

# dladm show-link
eri0    type: legacy    mtu: 1500       device: eri0 
qfe0    type: legacy    mtu: 1500       device: qfe0 
qfe1    type: legacy    mtu: 1500       device: qfe1 
qfe2    type: legacy    mtu: 1500       device: qfe2 
qfe3    type: legacy    mtu: 1500       device: qfe3 
bge0    type: non-vlan  mtu: 1500       device: bge0
# vi /etc/hostname.qfe0 netmask
# vi /etc/hostname.qfe1 netmask
# vi /etc/inet/hosts
# Internet host table 
#       localhost       myhost       interface-2       interface-3
For Solaris 10 11/06 and earlier releases:# vi /etc/inet/ipnodes myhost       interface-2       interface-3

At this point, you would reboot the system.

# reboot -- -r

After the system boots, you would then verify the interface configuration.

ifconfig -a
# ifconfig -a lo0: flags=1000849 <UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu
8232 index 1
         inet netmask ff000000  
eri0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
         inet ff000000 broadcast
         ether 8:0:20:c1:8b:c3  
qfe0:flags=1000843 <UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3  
      inet netmask ffffff00 broadcast
      ether 8:0:20:c8:f4:1d  
qfe1: flags=1000843 <UP,BROADCAST,RUNNING,MULTICAST,IPv4>mtu 1500 index 4
         inet netmask ffffff00 broadcast
        ether 8:0:20:c8:f4:1e 

See Also