Using the dladm command to customize common datalink properties provides the following benefits:
The dladm command is the only command interface that is required for configuring network driver properties. This command replaces the former practice of using a combination of the ndd command and driver.conf file modifications to set driver properties.
The following uniform syntax is used, regardless of which properties are set:
dladm subcommand properties datalink
Use of the dladm command applies to both public and private properties of the driver.
Using the dladm command on a specific driver does not disrupt network connections of other NICs of similar types. Thus, you can configure datalink properties dynamically.
Datalink configuration values are stored in a dladm repository and persist over system reboots.
When used without any options, the dladm command displays general information about the system's datalinks, including the class, state, and the underlying physical links.
# dladm LINK CLASS MTU STATE OVER net0 phys 1500 unknown -- net1 phys 1500 up -- net2 phys 1500 unknown -- net3 phys 1500 unknown -- net4 phys 1500 up -- aggr0 aggr 1500 up net1,net4
Datalinks can be of different classes, other than physical links, for example, link aggregations, virtual LANs (VLANs), and virtual NICs (VNICs). These other datalinks are also included in the default information that is displayed by the dladm command. For example, in the previous output a link aggregation (aggr0) is configured over the physical datalinks net1 and net4.
For information about link aggregations and VLANs, see Managing Network Datalinks in Oracle Solaris 11.3. For information about VNICs, see Managing Network Virtualization and Network Resources in Oracle Solaris 11.3.
Use the dladm show-link command to display both the physical and virtual datalinks on a system. A system has as many datalinks as there are installed NICs. You can use various options with this command to customize the information that is displayed.
When used with no additional options or arguments, the dladm show-link command displays the following information:
# dladm show-link LINK CLASS MTU STATE OVER net1 phys 1500 down -- net3 phys 1500 unknown -- net0 phys 1500 up -- net2 phys 1500 unknown -- net11 phys 1500 up -- net5 phys 1500 up -- net6 phys 1500 up --
In the previous output, the STATE column shows the current state of the virtual datalink. The state can be up, down, or unknown. For virtual datalinks, when a NIC is split up into multiple VNICs, a virtual switch is implicitly created internally. This creation of a virtual switch enables the VNICs and the primary datalink to communicate with each other, as long as they are on the same VLAN, even if the physical datalink has no connection to the external network. This relationship forms the virtual state of the datalink.
Use the –P option to display persistent configuration information about the datalinks. Based on the information that is provided by this command, you can proceed with further network configuration. For example, you can determine the number of NICs on the system, and you can select which datalink to use, over which you can configure IP interfaces. When you type the command, the information that is displayed is similar to the following example:
# dladm show-link -P LINK CLASS OVER net0 phys -- net1 phys -- net2 phys --
The previous example shows that the system has three datalinks that are directly associated with their corresponding physical NICs. No special datalinks exist, such as aggregations or virtual NICs, which are configured over the datalinks under the phys class.
Use the dladm show-phys command to obtain information about the system's datalinks in relation to the physical NICs with which they are associated. Used without any options, the command displays information that is similar to the following example:
# dladm show-phys LINK MEDIA STATE SPEED DUPLEX DEVICE net0 Ethernet up 100Mb full e1000g0 net1 Ethernet down 0Mb -- nge0 net2 Ethernet up 100Mb full bge0 net3 InfiniBand -- 0Mb -- ibd0
The previous output shows, among other details, the physical NICs with which the datalinks that have generic link names are associated. For example, net0 is the datalink name of the NIC e1000g0. To display information about flags that have been set for the datalinks, use the –P option. For example, a datalink that is flagged with r means that its underlying NIC has been removed.
In the previous output, the STATE column shows the current state of the physical datalink. The state can be up, down, or unknown. The physical link state identifies whether the physical device has connectivity with the external network (which it does, if the cable is plugged in and the state of the port on the other end of the cable is up.
The –L option is another useful option that you can use. This option displays the physical location for each datalink. The location determines the instance number of the datalink, such as net0, net1, and so on.
# dladm show-phys -L LINK DEVICE LOCATION net0 bge0 MB net2 ibp0 MB/RISER0/PCIE0/PORT1 net3 ibp1 MB/RISER0/PCIE0/PORT2 net4 eoib2 MB/RISER0/PCIE0/PORT1/cloud-nm2gw-2/1A-ETH-2
Use the –m option to display the MAC addresses of the physical links in a system:
# dladm show-phys -m LINK SLOT ADDRESS INUSE CLIENT net0 primary 0:11:22:a9:ee:66 yes net0
This command is similar to using the ifconfig command. See the ifconfig(5) man page.
Display the MAC addresses of all of the links in a system (physical and non-physical) as follows:
# dladm show-linkprop -p mac-address LINK PROPERTY PERM VALUE EFFECTIVE DEFAULT POSSIBLE net0 mac-address rw 0:11:22:a9:ee:66 0:11:22:a9:ee:66 0:11:22:a9:ee:66 --
Use the dladm delete-phys command to remove a datalink from the system. This command deletes Layer 2 components from the system only, which includes physical datalinks and other L2 entities such as aggregations, VNICs, VLANs, and flows. To delete Layer 3 configuration, for example, IP interfaces and addresses, use the ipadm command. See Removing or Modifying an IP Interface Configuration.
Removing a datalink is only loosely connected to the removal of a physical NIC. For example, if a physical NIC is removed from the system, the datalink configuration that is associated with that NIC remains because the software layer is no longer bound to the hardware layer, as described in Comparing the Oracle Solaris 10 Network Protocol Stack to the Oracle Solaris 11 Network Protocol Stack in Transitioning From Oracle Solaris 10 to Oracle Solaris 11.3. Thus, you can still use the datalink configuration on a different underlying physical NIC by assigning that datalink's name to the other NIC's associated link.
If you detach a NIC without replacing it, and you no longer need its datalink configuration, then you can delete the datalink as follows:
# dladm delete-phys datalink
Use the dladm rename-link command to rename a datalink. On an Oracle Solaris system, the OS automatically provides generic names to all datalinks. For more information about generic datalink names, see About Datalink Configuration.
By default, these generic names use the naming format netn, such as net0, net1, net2, and so on. Because the OS manages these names, you would not rename datalinks as a regular part of your administrative tasks. For a procedure that requires changing link names, see How to Move IP Configuration From One Network Device to Another Device.
You use the dlstat command to obtain runtime datalink statistics for all types of datalinks. When used by itself with no other options, the dlstat displays statistical information about all of the datalinks that are on the system, as shown in the following output:
% dlstat LINK IPKTS RBYTES OPKTS OBYTES net0 58.00K 9.52M 5.61K 1.91M
For more information about using the dlstat command, see Chapter 8, Monitoring Network Traffic and Resource Usage in Managing Network Virtualization and Network Resources in Oracle Solaris 11.3. See also the dlstat(1M) man page.