linux

Page 238

82935c11.qxd:Toolbox

10/29/07

1:16 PM

Page 213

Chapter 11: Managing Network Connections Advertised auto-negotiation: Yes Speed: 100Mb/s Duplex: Full Port: MII PHYAD: 1 Transceiver: internal Auto-negotiation: on Supports Wake-on: g Wake-on: g Current message level: 0x00000007 (7) Link detected: yes

You will need root permissions to acquire information about the Ethernet interface, hence the use of the sudo command in the previous example. To find out about the driver being used for a particular network card, use the -i option: $ sudo ethtool -i eth0 driver: e1000 version: 7.3.15-k2-NAPI firmware-version: 0.5-7 bus-info: 0000:04:00.0

Display driver information for NIC

Use the -S option to display detailed statistics for a NIC: $ sudo ethtool -S eth0 NIC statistics: rx_packets: 1326384 tx_packets: 773046 rx_bytes: 1109944723 tx_bytes: 432773480 rx_errors: 5 tx_errors: 2 rx_dropped: 0 tx_dropped: 0 multicast: 0 collisions: 0 rx_length_errors: 0 rx_over_errors: 0 rx_crc_errors: 5 rx_frame_errors: 0 rx_fifo_errors: 0 rx_missed_errors: 0 tx_aborted_errors: 0 tx_carrier_errors: 2 ...

Show statistics for NIC at eth0

The ethtool command can be used to change NIC settings as well as display them. To turn off auto-negotiation and hard-set the NIC to 100 Mpbs, full duplex, type this: $ sudo ethtool -s eth0 speed 100 duplex full autoneg off

Change NIC settings

213


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.