Schlagwort sollteCharly's hier Column stehen COVERSYSADMIN STORY

The Sysadmin’s Daily Grind: Ethtool NEGOTIATIONS

A touchy LAN that plays like a movie diva can spoil any admin’s day.

Ethtool to the rescue! BY CHARLY KÜHNAST

urphy got on the bus I was autoneg, but sometimes the errors riding a couple of days ago persist. Network engineers have - Mand followed me into my perienced situations in which ten apartment. When I fired up my laptop, NICs by the same vendor were - Murphy’s Law struck. My harmless plan tached to the same switch. Au- was to watch TV via streaming from my toneg worked for seven of the office. I have a VDR [1] set up in my cards, and it didn’t work for the lounge for this purpose, and a well-kept other three. home network [2] between the lounge The worst thing is that everything If you have a managed and the office to handle the rest. But the seems to be fine at first. The link LED switch (I don’t), you can hard-wire the performance was so jerky, I really lights up, you get prompt responses to values at the switch. thought I was watching a breakdancing pings. Looks good, until you start to movie. transmit larger volumes of data via the Tricks A (fairly exhaustive) diagnosis of the interface. You might be lucky, and actu- Ethtool has a few more tricks up its network hardware failed to reveal bro- ally notice the collision detection count sleeve. For instance, Ethtool gives you ken components. My switch is a dumb when you run . Collisions should granular control over WOL (Wake On device without management functional- not occur on a switched network. If they LAN) settings. ity, so there was nothing to diagnose. do, you are probably looking at a half- There is another function that looks What finally helped me save the day was duplex connection. like a but useless gimmick at first Ethtool [3]. sight. The ethtool -p eth0 command tells Automatic negotiation of the transmis- Repair Mode a NIC to flash its LED on and off. If you sion parameters between the switch and Luckily, Ethtool not only diagnoses this have ever been faced with a server that my laptop’s Gigabit port had failed. This kind of error; it can actually remove it. had eight NICs, and not had a clue failure not only resulted in a 100 Mbps The ethtool -r eth0 command relaunches which one is eth0, you might appreciate connection rather than ten times that autonegotiation, giving you a solution this feature. Of course, a flashing LED is speed, but the failure also set the trans- that is far more convenient than pulling no replacement for a good evening’s mission mode to half-duplex (see Figure the wires. In fact, this is your only vector televiewing. ■ 1). No wonder the transfer rate was so if you do not have physical access to the slow. hardware. I just don’t trust autoneg any INFO more, and this is why I hard-wire the [1] VDR: http:// www. cadsoft. de/ vdr/ Autonegotiation values, like this: Autonegotiation errors are a classical [2] If this column was available as a Pod- cast, readers could listen to my wife at case of Murphy’s law. They happen ethtool -s eth0 speed U this description of my home network enough to get on your nerves, but not 1000 duplex full autoneg off as “well-kept.” often enough to be automatic trouble- [3] Ethtool: http:// freshmeat. net/ redir/ shooting candidates. Sometimes errors ethtool/ 20128/ url_homepage/ gkernel can just disappear when you pull the cables and re-, as this initiates Charly Kühnast is a SYSADMIN System Man- ager at the data -cen- Orca ...... 54 ter in Moers, near Orca plots arbitrary data from text files, Germany’s famous and an add-on Procallator collects River Rhine. His tasks include ensur- performance information. We’ll show ing firewall security you how you can monitor Linux system Figure 1: Ethtool finds out why a full-duplex THEAUTHOR and availability and taking care of performance with Orca. Gigabit LAN connection fails to happen. the DMZ (demilitarized zone).

WWW.LINUX - MAGAZINE.COM ISSUE 65 APRIL 2006 53