• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to determine link status (up/down) of network interfaces in Solaris

by admin

There are several different ways to check the link status(up/down) in solaris. Below are several methods, with examples, to check network link status of Ethernet interfaces in Solaris. Some of the methods like dladm were not available in solaris 8 and 9. In that case we can use kstat and ndd commands.

1. Checking /var/adm/messages file for errors

Most of the times, link down messages are logged in the /var/adm/messages file. You just have to search through the file for the right error.

Sep 18 11:51:08 server1 qfe: [ID 349649 kern.notice] NOTICE: SUNW,qfe0: No response from Ethernet network : Link Down - cable problem 
Oct 1 08:37:06 server2 unix: SUNW,hme0: 100 Mbps full-duplex Link Up

2. Checking link status with ndd (Solaris 8 and 9)

In solaris 8 and 9, the dladm command will not work. In that case link status can be checked with the ndd command. First we need to set the instance of the specific interface we want to check.

# ndd -set /dev/ce instance 0         ### instance set to "0" checks ce0 status
# ndd   /dev/ce link_status
1
NOTE: link_status 1=up,0=down)

3. Checking link status with kstat (Solaris 8 and 9)

kstat is another useful command to check the link status. To check link status all interfaces of device driver type ce :

# kstat -p qfe:::link_up
qfe:0:qfe0:link_up        1
qfe:1:qfe1:link_up        1

…or just a single instance:

# kstat -p e1000g:0::link_up
e1000g:0:mac:link_up    1
NOTE: link_up (1=up,0=down)

4. Checking link status with dladm (Solaris 10 and 11)

Starting solaris 10, dladm command can be used which gives a more formatted output for all the network interfaces with link status and link speed as well.

# dladm show-dev
e1000g0      link: up            speed: 1000  Mbps       duplex: full
e1000g1      link: unknown   speed: 0       Mbps       duplex: half

For solaris 11, the command is slightly changed :

# dladm show-link
LINK                CLASS     MTU    STATE    OVER
net0                phys      1500   up       --
net1                phys      1500   up       --

or, you can also use the below command, which give more detailed information.

# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net0              Ethernet             up         1000   full      e1000g0
net1              Ethernet             up         1000   full      e1000g1

6. Checking link speed at ok prompt

On solaris SPARC systems, we can watch individual interfaces to see if they have a link. At the OBP prompt on the client, use the “watch-net-all” command to test and see the network devices.

ok> watch-net-all
/pci@7c0/pci@0/network@4,1
1000 Mbps full duplex  Link up
Looking for Ethernet Packets.
'.' is a Good Packet.  'X' is a Bad Packet.
Type any key to stop.
.................................................
/pci@7c0/pci@0/network@4
Timed out waiting for Autonegotiation to complete
Check cable and try again
Link Down
/pci@7c0/pci@0/pci@8/network@1,1
Timed out waiting for Autonegotiation to complete
Check cable and try again
Link Down
/pci@7c0/pci@0/pci@8/network@1
Timed out waiting for Autonegotiation to complete
Check cable and try again
Link Down

7. Examining RUNNING flag in ifconfig output

Another easy way to quickly check the interface link status – is to check “ifconfig -a” command output. The RUNNING flag is cleared when the link is down.

# ifconfig -a
......
e1000g0: flags=1000843[UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 192.168.1.25 netmask ffffff00 broadcast 192.168.1.255
        ether 0:c:29:92:7b:cd
......

8. mpathd notices

If you are using IPMP, the mpathd daemon will detect NIC failures and repairs and log them in /var/adm/messages file.

"NIC failure detected on qfe0"                     - in.mpathd has detected that NIC qfe0 is repaired and operational
"Successfully failed back to NIC qfe0 to NIC qfe1" - in.mpathd has restored network traffic back to NIC qfe0, which is now repaired and operational.

8. Checking link status with SNMP

The snmpwalk command is rarely used to find link status. But it can also be used ti query the link status of a remote host, which in some cases can be very useful. The snmp class queried here to get link status is interfaces.ifTable.

# snmpwalk -v1 -c public localhost interfaces.ifTable | egrep "Descr|OperStatus"
IF-MIB::ifDescr.1 = STRING: lo0 
IF-MIB::ifDescr.2 = STRING: ce0 
IF-MIB::ifDescr.3 = STRING: ce1 
IF-MIB::ifDescr.4 = STRING: ce2 
IF-MIB::ifDescr.5 = STRING: ce3 
IF-MIB::ifOperStatus.1 = INTEGER: up(1)
IF-MIB::ifOperStatus.2 = INTEGER: up(1) 
IF-MIB::ifOperStatus.3 = INTEGER: up(1) 
IF-MIB::ifOperStatus.4 = INTEGER: down(2) 
IF-MIB::ifOperStatus.5 = INTEGER: up(1)
NOTE:
1. up(1), down(2)
2. ‘public’ is the default SNMP v1/v2c read community string here and can be different on your system.
3. You can run the same command against remote hostname instead of localhost.

Filed Under: Solaris

Some more articles you might also be interested in …

  1. Solaris ZFS : How to import 2 pools that have the same names
  2. How to enable or disable telnet in Solaris 10
  3. Solaris 11 : How to Control Allocated Bandwidth of Network Interface on Per App/User Basis
  4. What is SUID, SGID and Sticky bit ?
  5. Solaris 11 : How to monitor network traffic using “ipstat”, “tcpstat” and “netstat” commands
  6. How to add swap file in Solaris
  7. How to add Additional Storage Space Created from Dynamic LUN Expansion in ZFS online
  8. Resolving File System Full Situations in Solaris
  9. How to Configure a Solaris 10 Jumpstart server and client [SPARC]
  10. How to collect XSCF snapshot on M-series servers (M3000 / M4000 / M5000 / M8000 / M9000)

You May Also Like

Primary Sidebar

Recent Posts

  • vgextend Command Examples in Linux
  • setpci command – configure PCI device
  • db_load command – generate db database
  • bsdtar command – Read and write tape archive files

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright