General Debug Commands

The following list provides examples for the commands generally used for debugging Ethernet connections.
  • Check Ethernet device information:
    • Check adapter status:
      ifconfig eth0
    • Check data package send and receive statistics:
      cat /proc/net/dev
    • Check the current speed:
      cat /sys/class/net/eth0/speed
  • Enable or disable an Ethernet device.

    • Enable:
      ifconfig eth0 up
    • Disable:
      ifconfig eth0 down
  • Configure an Ethernet device.

    • Configure static IP address:
      ifconfig eth0 192.168.1.101
    • Configure MAC address:
      ifconfig eth0 hw ether 00:11:22:aa:bb:cc
    • Automatically obtain the IP address:
      udhcpc -i eth0
    • Set PHY mode: (Set the speed of 100 M, enable full duplex and auto negotiation.)
      ethtool -s eth0 speed 100 duplex full autoneg on
  • General test commands:

    • Connection test:
      ping 192.168.1.101
    • Throughput test:

      Note: Make sure you have enabled the iperf tool in the kernel menu before performing the test.
      • TCP throughput test:

        Server side:
        iperf3 -s -i 1
        Client side:
        iperf3 -c 192.168.1.101 -i 1 -t 60 -P 4
      • UDP throughput test:

        Server side:
        iperf3 -s -u -i 1
        Client side:
        iperf3 -c 192.168.1.101 -u -b 100M -i 1 -t 60 -P 4