ethtool : How to Know your LAN Card Status from LINUX

Couple weeks ago, there were problems reported came in my desk related to weird things about LAN connection happened in some place on branch office computers. The fact that one of the LINUX server unable to ping to others LINUX client connected in a LAN and so did from the clients. But the odd things was, the ping connection is successfully from the Windows. Windows displayed normally LAN connection status with default speed of 100Mbps.

So what is the problem with LINUX? First thing, I got checked out the interface with ethtool software from LINUX (standard package found on Redhat setup CDs). This tiny tool displayed the LAN interface more and more details. From the server terminal, I wrote the default command “ethtool eth0” (with assumption that the LAN card is linked to eth0 device file).
[root@server ~]# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: Yes
Speed: 10Mb/s Duplex: Half
Port: MII
PHYAD: 32
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: d
Current message level: 0x00000007 (7)
Link detected: yes
Everything is normal, nothings to be wrong on the server. The switch and cables is OK, this is the report answer from last information in Link detected: yes. What about the clients? I also got checked 2 sample client with the same command here, and what the each display said?
[root@client1 ~]# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s Duplex: Full
Port: MII
PHYAD: 32
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: d
Current message level: 0x00000007 (7)
Link detected: yes
Yes, there are differences here. The server LAN adapter are working with default speed: 10Mbps (Half duplex), while the clients are in 100Mbps (Full duplex). From these, I tried to force the server to working in clients mode (100 Mbps – Full duplex) with command below:
[root@server ~]# ethtool –s eth0 speed 100 duplex full autoneg off
And voila! The server are working good and ping was successful also the interface status now are same as the client. So, what is the interesting point with the command above? Since I had to force the interface to the same mode as client and the server interface are fully negotiable (shake-hand), so I inserted the parameter autoneg with off value in the last command statement.

Another situation I had face when I tried to connecting the web server in a WAN on one of my experience project. The server LAN on-board interface are looking normal.
[root@webserver ~]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:01:6C:C2:66:3F
inet addr:10.1.7.50 Bcast:10.1.7.255 Mask:255.255.255.0
inet6 addr: fe80::201:6cff:fec2:663f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:265668 errors:0 dropped:0 overruns:0 frame:0
TX packets:945883 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:16602948 (15.8 MiB) TX bytes:1238752271 (1.1 GiB)
Interrupt:11 Base address:0xd100
Without LAN-tester toolkit, I got checked the cables heading to switch. First, I run the command within the cables unplugged:
[root@webserver ~]# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: Yes
Speed: Unknown! (65536) Duplex: Unknown! (256)
Port: MII
PHYAD: 32
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: d
Current message level: 0x00000007 (7)
Link detected: no
Second, run the same command with cable plugged in the LAN adapter:
[root@webserver ~]# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s Duplex: Full
Port: MII
PHYAD: 32
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: d
Current message level: 0x00000007 (7)
Link detected: no
The Link detected: no status tell that there is something wrong with the cable heading to switch. Then I switch the new cable and once again run the same command:
[root@webserver ~]# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s Duplex: Full
Port: MII
PHYAD: 32
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: d
Current message level: 0x00000007 (7)
Link detected: yes
Bingo! The problem has solved without LAN-tester kit exist. The connection are now seems to be working well.

Sincerelly,

Eko Wahyudiharto
PS: If you've benefit from this blog,
you can support it by making a small contribution.

Enter your email address:

Delivered by FeedBurner

Post a Comment Bookmark and Share

 

  1. Blogger Dedi said,

    Tuesday, February 10, 2009 6:36:00 AM

    Nice article
    Just curious, do you know what PHYAD stands for? I've tried googling it, but I don't get any good definition

    Thanks

  2. Blogger Eko Wahyudiharto said,

    Tuesday, February 10, 2009 2:06:00 PM

    PHYAD stands for PHY ADdress. But anyway, I can't define what is PHY means? A document out there will describe you about this. Check this out.

  3. Anonymous Elmo said,

    Thursday, June 04, 2009 12:32:00 PM

    Help me with this LINUX boot up error:
    * WARNING: net.eth0 has started, but is inactive

  4. Blogger Eko Wahyudiharto said,

    Thursday, June 04, 2009 3:40:00 PM

    @Elmo: What the log file was said?

  5. Anonymous Dennis van der Pool said,

    Wednesday, June 24, 2009 11:46:00 PM

    Seems to me it stands for PHYsical ADdress (= MAC Address) :-)

  6. Blogger Eko Wahyudiharto said,

    Thursday, June 25, 2009 11:02:00 AM

    @Dennis van der Pool: I think u're correct

  7. Anonymous Ganesh DVR said,

    Wednesday, November 04, 2009 6:45:00 AM

    PHYAD ,as the name implies is PHY ADDRESS. But in reality it displays the port number on the system/switch for the on which ethtool command is used to query the value.
    For example, a PHYAD of 23 would mean (port number 23) on the system being queried. Also look for the port number range (0 based or 1 based).

  8. Blogger Eko Wahyudiharto said,

    Wednesday, November 04, 2009 11:00:00 PM

    @Ganesh DVR: Thanks for the explanation Mr. Ganesh...

  9. Blogger Rajeev said,

    Wednesday, February 03, 2010 12:21:00 AM

    what is Supported ports: [ TP MII ] and PORT MII in

    ACC# ethtool eth0
    Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Supports auto-negotiation: Yes
    Advertised link modes: 100baseT/Half 100baseT/Full
    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

  10. Blogger TheRunningNobody said,

    Tuesday, March 20, 2012 6:23:00 PM

    woah ! We had the same occult problem with one of our software solution deployment. Thx a lot. You rock !

Post a Comment

Leave comments here...