ethtool : How to Know your LAN Card Status from LINUX
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 eth0Everything 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?
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
[root@client1 ~]# ethtool eth0Yes, 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:
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
[root@server ~]# ethtool –s eth0 speed 100 duplex full autoneg offAnd 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 eth0Without LAN-tester toolkit, I got checked the cables heading to switch. First, I run the command within the cables unplugged:
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
[root@webserver ~]# ethtool eth0Second, run the same command with cable plugged in the LAN adapter:
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
[root@webserver ~]# ethtool eth0The 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:
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
[root@webserver ~]# ethtool eth0Bingo! The problem has solved without LAN-tester kit exist. The connection are now seems to be working well.
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
