-1

I have small issue with my openwrt router. I want to know link-speed in format 10M,100M, 1000M, etc. or 10BaseT .. but I can't find it in /proc or with "ip" command also "dmesg" doesn't provide this data.

Have you any ideas where can I find it? If data be in Hex format it's enough for me. Thanks.

sjwrong
  • 21
  • 1
  • 1
  • 2

2 Answers2

4

You can use the ethtool command

http://linux.die.net/man/8/ethtool

EDIT:

You need to check the 'Speed' section. Check below:

root ~ ethtool eth0
Settings for eth0:
    Supported ports: [ TP ]
    Supported link modes:   10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Full
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Advertised link modes:  10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Full
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes
    Speed: 100Mb/s
    Duplex: Full
    Port: Twisted Pair
    PHYAD: 1
    Transceiver: internal
    Auto-negotiation: on
    MDI-X: off (auto)
    Supports Wake-on: pumbg
    Wake-on: g
    Current message level: 0x00000007 (7)
                   drv probe link
    Link detected: yes

As you can see, my card supports 10/100/1000 however, the 'Speed' section shows the speed it is currently running at:

Speed: 100Mb/s

Mugurel
  • 903
  • 1
  • 9
  • 17
  • thanks for answer, I haven't got ethtool in my openwrt router... is there any solution? – sjwrong Aug 08 '16 at 11:57
  • yes, of course, but I want to find out working speed, NO HW speed, – sjwrong Aug 08 '16 at 12:07
  • I've edited my answer to clarify. – Mugurel Aug 08 '16 at 12:12
  • Yes, that would be great, but I havent got this ethtool, So, Can you tell me from where ettoll reads this data? I mean some file in /proc or somthing like this. is it possibel? :) thanks much – sjwrong Aug 08 '16 at 12:15
  • 1
    @sjwrong google is your friend - seriously https://www.google.co.uk/search?q=openwrt+install+package and https://www.google.co.uk/search?q=openwrt+install+ethtool – user9517 Aug 08 '16 at 12:26
  • @lain :) I know how to install package to owrt/ also how to compile whole Firmware, but I need to do it without any tool. Only read it from somewhere and that's all. Reason why I cannot install any package is, I have very small flash , and these tools is too big for me – sjwrong Aug 08 '16 at 12:38
1

After few hours of reading /proc/* files I have found solution. chipset: ar8113

"cat /proc/ar8113/port_status"

and output is:

LinkUp | NWay Mode Enabled RXPause Enabled | TXPause Enabled Duplex Enabled | Speed 100M

sjwrong
  • 21
  • 1
  • 1
  • 2