dladm – Display Link status,speed,duplex,statistics,MTU

In the past we have to mess around with the NDD commands and stats tools like kstat to find the network link status, speed, duplex information in Sun Solaris. With Solaris 10, this has become much easier with the dladm utility.

dladm is the admin utility for Data-Link Interface which helps to display informarthe like Link Status (UP/DOWN), Speed, Duplex, MTU, VLAN Tagged and crucially statistics of network traffic on each of the interfaces historically as well as in real time. dladm can also configure and admin Link Aggregation on multiple NICs which we will not focus here.

Show Link Status/Speed/Duplex

# dladm show-dev
nxge0           link: down      speed: 0     Mbps       duplex: unknown
nxge1           link: down      speed: 0     Mbps       duplex: unknown
nxge2           link: up        speed: 1000  Mbps       duplex: full
nxge3           link: up        speed: 1000  Mbps       duplex: full

As you can see above the “show-dev” option lists all the network interfaces with Link Status (UP/DOWN), current speed in Mbps and Duplex (Half/Full)

Show Link Status

# dladm show-link
nxge0           type: non-vlan  mtu: 1500       device: nxge0
nxge1           type: non-vlan  mtu: 1500       device: nxge1
nxge2           type: non-vlan  mtu: 1500       device: nxge2
nxge3           type: non-vlan  mtu: 1500       device: nxge3

Here “show-link” option reveals the MTU and the VLAN tagging detail on each of the interfaces on the system.

Show Stats of all Interfaces for all time

# dladm show-dev -s
ipackets  rbytes         ierrors opackets        obytes      oerrors
nxge0           0         0           0       0         0           0
nxge1           0         0           0       0         0           0
nxge2           179625752557169463759657      581104982 3964684165410
nxge3           22240891  1834257868  0       5198483   395084708   0

The “-s” option along with “show-dev” or “show-link” displays network traffic statistics including Input/Output packets, input/output errors.

Stats in real-time

To show the stats of a particular interface in real-time use the “-i” option which is the interval in seconds. The first line shows again historic stats and later on the real-time information for every “n” seconds (5 seconds in our example)

# dladm show-link -s -i 5 nxge2
ipackets  rbytes         ierrors opackets        obytes      oerrors
nxge2           179637824757173944575957      581119516 3964706801670
ipackets  rbytes         ierrors opackets        obytes      oerrors
nxge2           961       319105             0       150       17874       0
ipackets  rbytes         ierrors opackets        obytes      oerrors
nxge2           887       263850             0       117       16505       0

If we fail to mention the interface then it takes the default interface (1st in the list). As you can see from the example below, we see stats for nxge0 which is not connected.

# dladm show-link -s -i 5
ipackets  rbytes         ierrors opackets        obytes      oerrors
nxge0           0         0           0       0         0           0
ipackets  rbytes         ierrors opackets        obytes      oerrors
nxge0           0         0           0       0         0           0

5 thoughts on “dladm – Display Link status,speed,duplex,statistics,MTU”

  1. Pingback: ssh Long time to return prompt. - SUN Solaris - The UNIX and Linux Forums

  2. In dladm show-dev output link status showing up but duplex is showing unknown. What may be reason? its not in ipmp. and network side it is showing full duplex

Leave a Comment

Your email address will not be published. Required fields are marked *