ethers - Linux


Overview

ethers is a versatile tool for managing and displaying network interface information on Linux systems. It allows users to scan for, query, and monitor network interfaces, providing insights into their IP addresses, MAC addresses, link status, and other attributes.

Syntax

ethers [options] [interface]...

Options/Flags

  • -i: List all interfaces and their MAC addresses.
  • -s: Display only non-running interfaces.
  • -v: Enable verbose output, providing additional details about each interface.
  • -t: Test for Ethernet cable presence.
  • -f: Format the output in table format.
  • -r: Reverse the order of the output.
  • -u: Update the MAC address database.
  • -w: Show MAC addresses in writable format.

Examples

Simple Usage:

# List all network interfaces
ethers

# Display non-running interfaces
ethers -s

Advanced Usage:

# Show verbose output for a specific interface
ethers -v eth0

# Test for Ethernet cable presence
ethers -t eth1

Common Issues

Interface Not Found:

Ensure the specified interface name is correct and exists on the system. Use ifconfig to verify the interface name.

Permission Denied:

Running ethers may require root privileges. Try using sudo ethers.

Integration

Example Script:

#!/bin/bash

for iface in $(ethers -i | awk '{print $1}'); do
    ifconfig $iface up
done

Related Commands

  • ifconfig: Configure and display network interface settings.
  • ip: Manage network interfaces and IP addresses.
  • iwconfig: Configure and display wireless network interfaces.