System Administration Guide: Network Interfaces and Network Virtualization

ProcedureHow to Configure an IP Interface After System Installation

Link configuration and IP interface configuration are two separate tasks. However, the following procedure combines the two tasks together to illustrate how an IP interface is created that has the same name as the data link. Thus, after plumbing an IP interface, for example, the link name is propagated up to the IP administrative and programmatic interfaces.

  1. On the system with the interface 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. Display information about physical attributes of data links currently on the system.


    # dladm show-phys
    

    For more information about this command, see How to Display Information About Physical Attributes of Data Links.

  3. If you intend to rename a data link, then make sure that the link is not opened by any application.

    For example, if the IP interface over the link is plumbed, then unplumb the interface.


    # ifconfig interface unplumb
    

    where interface refers to the IP interface that is plumbed and using the link.

  4. (Optional) Assign a meaningful name to the data link.


    # dladm rename-link old-linkname new-linkname
    
    old-linkname

    Refers to the current name of the data link. When a NIC is installed for the first time, by default, the NIC's link name is hardware-based, such as bge0.

    new-linkname

    Refers to any name that you want to assign to the data link. For rules for assigning link names, refer to Rules for Valid Link Names.


    Note –

    Although this step is optional, assigning a customized name to a link is recommended. For more information, see Considerations for Working With Link Names.


  5. Configure the IP interface over the link with a valid IP address..


    # ifconfig interface plumb IP-address up
    

    where interface refers to the IP interface you are configuring over the link and the IP-address uses the the CIDR notation. The IP interface is identified by the name of the link. Thus, if you renamed the link in the previous step, you use the same name when you configure the IP interface. See the example that follows this procedure for reference.

    This step also brings that IP address up and enables the IP interface.

    For arguments that you can use with the ifconfig command such as broadcast, refer to the ifconfig(1M) man page. See also Monitoring the Interface Configuration With the ifconfig Command for examples of the different usages of the command.


    Note –

    This step and all subsequent steps that describe the configuration of an IP interface apply to IPv4 interfaces. To configure IPv6 interfaces, refer to Configuring an IPv6 Interface in System Administration Guide: IP Services


  6. (Optional) Display the network data-link information.


    # dladm show-link
    

    For more information about this command, see How to Display Data Link Information.

  7. (Optional) Display information about the newly configured IP interface.


    # ifconfig interface
    
  8. (Optional) To make the interface configuration persist across reboots, perform the following steps:

    1. Create an /etc/hostname.interface file for the IP interface.

    2. Using a text editor, edit the /etc/hostname.interface file by adding the IP address.

      At a minimum, add the IPv4 address of the interface to the file. The address can be in traditional IPv4 notation or CIDR notation. For example, you can also use the following syntax:


      # echo IP-address > /etc/hostname.interface
      
    3. Add entries for the IP addresses into the /etc/inet/hosts file.

      The entries in this file consist of IP addresses and the corresponding host names.

    4. Reboot the system.


      # reboot
      

Example 2–1 Configuring the Network Interface

This example uses partial information from Figure P–2 to configure the data link qfe3 on the host campus01. The example also shows a persistent configuration.


# dladm show-phys
LINK     MEDIA        STATE     SPEED     DUPLEX     DEVICE
qfe3     Ethernet     up        100Mb     full       qfe3

# ifconfig qfe3 unplumb
# dladm rename-link qfe3 subitops1
# ifconfig subitops1 plumb 192.168.84.3/24 up
# dladm show-link
LINK          CLASS     MTU     STATE     OVER
subitops1     phys      1500    up        --

# ifconfig subitops1
subitops1: flags=1000843 <UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 192.168.84.3 netmask ffffff00 broadcast 192.168.84.255
        ether 8:0:20:c8:f4:1d 

# echo 192.168.84.3/24 > /etc/hostname.subitops1

# vi /etc/inet/hosts
# Internet host table
#
127.0.0.1       localhost
10.0.0.14       myhost
192.168.84.3       campus01

# reboot