NS ethtool Linux utilities allow you to view and change some of your network driver and interface card settings, especially for wired devices. These include speed, whether the interface uses auto-negotiation, whether to run in half-duplex mode or full-duplex mode, and other settings. Ethtool also provides an easy way to view or troubleshoot your network interface.
probably, ethtool Already available on Linux systems. However, you can use one or both of the following commands to verify.
$ which ethtool /usr/sbin/ethtool $ sudo ethtool —version ethtool version 5.13
To understand how this utility can control the settings, run a command similar to the following: NS -NS It means “help”. You’ll notice that you’re looking at a 10-page syntax like the one shown here.
$ ethtool -h | more ethtool version 5.13 Usage: ethtool [ FLAGS ] DEVNAME Display standard information about device ethtool [ FLAGS ] -s|—change DEVNAME Change generic options [ speed %d ] [ lanes %d ] [ duplex half|full ] [ port tp|aui|bnc|mii|fibre|da ] [ mdix auto|on|off ] [ autoneg on|off ] [ advertise %x[/%x] | mode on|off ... [—] ] [ phyad %d ] [ xcvr internal|external ] [ wol %d[/%d] | p|u|m|b|a|g|s|f|d... ] [ sopass %x:%x:%x:%x:%x:%x ] [ msglvl %d[/%d] | type on|off ... [—] ] [ master-slave preferred-master|preferred-slave|forced-master|forced-slave ] ethtool [ FLAGS ] -a|—show-pause DEVNAME Show pause options ethtool [ FLAGS ] -A|—pause DEVNAME Set pause options [ autoneg on|off ] [ rx on|off ] —More—
Obviously there are many things ethtool The utility can be done for you. However, to view the network interface settings, enter ethtool followed by the name of the network interface (for example, eth0). The following example looks at a network interface named enp0s25.
$ ethtool enp0s25: Settings for enp0s25: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Supported pause frame use: No Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Advertised pause frame use: No Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Speed: 100Mb/s Duplex: Full Auto-negotiation: on Port: Twisted Pair PHYAD: 1 Transceiver: internal MDI-X: on (auto) Current message level: 0x00000007 (7) drv probe link Link detected: yes
Note the “yes” in the last line indicating that this interface is working. The output also shows that it has supported link modes and that auto-negotiation is turned on. Notice the speed (100Mbps) and the interface running at full duplex.
You can check the Ethernet driver settings using a command similar to the following:
$ ethtool -i enp0s25 driver: e1000e version: 5.13.9-200.fc34.x86_64 firmware-version: 1.1-2 expansion-rom-version: bus-info: 0000:00:19.0 supports-statistics: yes supports-test: yes supports-eeprom-access: yes supports-register-dump: yes supports-priv-flags: yes
Network interface statistics
To view network interface statistics, you can use a command similar to the following: The output has been split into two columns to make it easier to see the settings.
$ ethtool -S enp0s25 | column NIC statistics: tx_single_coll_ok: 0 rx_packets: 455502 tx_multi_coll_ok: 0 tx_packets: 44344 tx_timeout_count: 0 rx_bytes: 79840149 tx_restart_queue: 0 tx_bytes: 4734660 rx_long_length_errors: 0 rx_broadcast: 261026 rx_short_length_errors: 0 tx_broadcast: 35 rx_align_errors: 0 rx_multicast: 154850 tx_tcp_seg_good: 165 tx_multicast: 3561 tx_tcp_seg_failed: 0 rx_errors: 0 rx_flow_control_xon: 0 tx_errors: 0 rx_flow_control_xoff: 0 tx_dropped: 0 tx_flow_control_xon: 0 multicast: 154850 tx_flow_control_xoff: 0 collisions: 0 rx_csum_offload_good: 289057 rx_length_errors: 0 rx_csum_offload_errors: 0 rx_over_errors: 0 rx_header_split: 0 rx_crc_errors: 0 alloc_rx_buff_failed: 0 rx_frame_errors: 0 tx_smbus: 0 rx_no_buffer_count: 0 rx_smbus: 0 rx_missed_errors: 0 dropped_smbus: 0 tx_aborted_errors: 0 rx_dma_failed: 0 tx_carrier_errors: 0 tx_dma_failed: 0 tx_fifo_errors: 0 rx_hwtstamp_cleared: 0 tx_heartbeat_errors: 0 uncorr_ecc_errors: 0 tx_window_errors: 0 corr_ecc_errors: 0 tx_abort_late_coll: 0 tx_hwtstamp_timeouts: 0 tx_deferred_ok: 0 tx_hwtstamp_skipped: 0
There are no conflicts or errors. That’s a good sign.
To test the network interface, you need to use: sudo And with the following command -NS (Test) option. Notice that the interface passed the test.
$ sudo ethtool -t enp0s25 The test result is PASS <== PASS! The test extra info: Register test (offline) 0 Eeprom test (offline) 0 Interrupt test (offline) 0 Loopback test (offline) 0 Link test (on/offline) 0
Note that all of these tests are running in offline mode. There are two modes, online and offline, with offline being the default. Runs the full set of tests, but may interrupt normal operation. Online testing is limited and uninterrupted. Keep this in mind if you are working in a production system.
You must use to change the network interface sudo Or run as root. In addition, the changes are not retained across reboots unless you also change the settings in the configuration file for a particular Linux distribution.For some changes you will also need to bring the interface down ifdown And backup ifup Therefore, you need to work in the system console.
Copyright © 2021 IDG Communications, Inc.
Check the network interface of your Linux system with ethtool
Source link Check the network interface of your Linux system with ethtool