System Administration Guide: Network Interfaces and Network Virtualization

Data Link and IP Interface Configuration (Tasks)

This section describes basic configuration procedures on a data link.

Table 2–1 Configuring Network Links (Task Map)

Task 

Description 

For Instructions 

Sets a system to support unique MAC addresses. 

Configures a SPARC based system to allow unique MAC addresses for interfaces. 

SPARC: How to Ensure That the MAC Address of an Interface Is Unique

Configure an IP interface over a data link. 

Performs basic IP interface configuration. 

How to Configure an IP Interface After System Installation

Replace a network interface card (NIC). 

Changes NICs in a system during dynamic reconfiguration. 

How to Replace a Network Interface Card With Dynamic Reconfiguration

Set per-link autopush properties.

Configures STREAMS modules to be pushed on top of a data link. 

How to Set STREAMS Modules on Data Links

Rename a data link. 

Changes the name of a link to any chosen name for better identification. 

How to Rename a Data Link

Display physical attributes of a data link. 

Lists physical information that underly a data link, including type of media, associated device instance, and other information. 

How to Display Information About Physical Attributes of Data Links

Display state of data links. 

Lists information about the status of data links. 

How to Display Data Link Information

Remove a data link. 

Removes a link configuration that is associated with a NIC no longer in use. 

How to Delete a Data Link

ProcedureSPARC: How to Ensure That the MAC Address of an Interface Is Unique

Some applications require every interface on a host to have a unique MAC addresses. However, every SPARC based system has a system-wide MAC address, which by default is used by all interfaces. Here are two situations where you might want to configure the factory-installed MAC addresses for the interfaces on a SPARC system.

The EEPROM parameter local-mac-address? determines whether all interfaces on a SPARC system use the system-wide MAC address or their unique MAC address. The next procedure shows how to use the eeprom command to check the current value of local-mac-address? and change it, if necessary.

  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 whether all interfaces on the system currently use the system-wide MAC address.


    # eeprom local-mac-address?
    local-mac-address?=false

    In the example, the response to the eeprom command, local-mac-address?=false, indicates that all interfaces do use the system-wide MAC address. The value of local-mac-address?=false must be changed to local-mac-address?=true before the interfaces can become members of an IPMP group. You should also change local-mac-address?=false to local-mac-address?=true for aggregations.

  3. If necessary, change the value of local-mac-address? as follows:


    # eeprom local-mac-address?=true
    

    When you reboot the system, the interfaces with factory-installed MAC addresses now use these factory settings, rather than the system-wide MAC address. Interfaces without factory-set MAC addresses continue to use the system-wide MAC address.

  4. Check the MAC addresses of all the interfaces on the system.

    Look for cases where multiple interfaces have the same MAC address. In this example, all interfaces use the system-wide MAC address 8:0:20:0:0:1.


    ifconfig -a
    lo0: flags=1000849 <UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
          inet 127.0.0.1 netmask ff000000  
    hme0: flags=1004843 <UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
          inet 10.0.0.112 netmask ffffff80 broadcast 10.0.0.127
          ether 8:0:20:0:0:1 
    ce0: flags=1004843 <UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
          inet 10.0.0.114 netmask ffffff80 broadcast 10.0.0.127
          ether 8:0:20:0:0:1 
    ce1: flags=1004843 <UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
          inet 10.0.0.118 netmask ffffff80 broadcast 10.0.0.127
          ether 8:0:20:0:0:1

    Note –

    Continue to the next step only if more than one network interface still has the same MAC address. Otherwise, go on to the final step.


  5. If necessary, manually configure the remaining interfaces so that all interfaces have unique MAC address.

    Specify a unique MAC address in the /etc/hostname.interface file for the particular interface.

    In the example in Step 4, you would need to configure ce0 and ce1 with locally administered MAC addresses. For example, to reconfigure ce1 with the locally administered MAC address 06:05:04:03:02, you would add the following line to /etc/hostname.ce1:


    ether 06:05:04:03:02 
    

    Note –

    To prevent any risk of manually configured MAC addresses conflicting with other MAC addresses on your network, you must always configure locally administered MAC addresses, as defined by the IEEE 802.3 standard.


    You also can use the ifconfig ether command to configure an interface's MAC address for the current session. However, any changes made directly with ifconfig are not preserved across reboots. Refer to the ifconfig(1M) man page for details.

  6. Reboot the system.

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

ProcedureHow to Replace a Network Interface Card With Dynamic Reconfiguration

Aside from servers, most laptops have PCMCIA slots that support dynamic reconfiguration (DR). This procedure shows how DR is now facilitated by the separation of the network link configuration from the network hardware configuration. You no longer need to reconfigure your network links after you complete DR. Instead, you just transfer the link configurations of the removed NIC to be inherited by the replacement NIC.

Before You Begin

Procedures to perform DR vary with the type of system. Make sure that you complete the following first:

  1. Assume the proper role that allows you to perform DR on the system, such as the Primary Administrator role or 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. (Optional) Display information about physical attributes of data links currently on the system.


    # dladm show-phys
    
  3. Perform the DR procedures as detailed in your system's documentation to remove a NIC and then insert a replacement NIC.

    Consult your system's DR documentation to perform this step.

    After you have installed the replacement NIC, proceed to the next step.

  4. Make sure that the replacement NIC is not being referenced by other configurations in the system.

    For example, the replacement NIC you install is ce0. If a file /etc/hostname.ce0 exists in the system, remove that file.

  5. Transfer the link configuration of the removed NIC to the replacement NIC.


    # dladm rename-link replacementNIC-linkname removedNIC-linkname
    
    replacementNIC-linkname

    Refers to the default link name of the replacement NIC upon installation. When you insert a NIC into a system for the first time, the NIC's link name is hardware-based, such as bge0 or ce0.

    removedNIC-linkname

    Refers to the customized link name of the NIC that you removed.

  6. Complete the DR process by enabling the new NIC's resources to become available for use by the Solaris release.

    For example, you use the cfgadm command to configure the NIC. For more information see the cfgadm(1M) man page.

  7. (Optional) Display link information.

    For example, you can use either dladm show-phys or dladm show-link to show information about the data links.


Example 2–2 Replacing a Network Card

This example shows how a bge card with link name net0 is replaced by a ce card. The link configurations of net0 are transferred from bge to ce after ce is connected to the system.


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

You perform the DR-specific steps such as using cfgadm to disconnect bge and then install ce. Then the procedure continues.


# ls /etc/hostname.*
hostname.ce0

# rm /etc/hostname.ce0
# dladm rename-link ce0 net0

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