× Introducing the Orbi 970 Series Mesh System with WiFi 7 technology. For more information visit the NETGEAR Press Room.
Orbi WiFi 7 RBE973
Reply

How to tell what the negotiated link speed of the LAN ports are (in cli)?

Retired_Member
Not applicable

How to tell what the negotiated link speed of the LAN ports are (in cli)?

Hi,

I have a R6220 router and a question. Is there a option to get statistic of ports in router command line? On web interface (ADVANCED > Internet Port > Show Statistics) i can see a nice summary (http://routerlogin.net/RST_statistics.htm😞

Port    	Status          TxPkts  RxPkts          Collisions Tx B/s Rx B/s Up Time
WAN		1000M/Full	3680522	11173704	0	   3368	  26198	 32:18:29
LAN1		Link down							 --
LAN2		100M/Full							 09:26:16
LAN3		1000M/Full	7941386	2601736		0	   88187  7016	 09:26:16
LAN4		1000M/Full							 09:26:16
2.4G WLAN b/g/n	--		--	--		--	   --	  --	 --
5G WLAN a/n/ac	867M		3629288	1442531	        0	   3304	  2176	 32:18:45

 

Regards!

Model: R6220|AC1200 Smart WiFi Router with External Antennas
Message 1 of 7
antinode
Guru

Re: How to tell what the negotiated link speed of the LAN ports are (in cli)?

> [...] Is there a option to get statistic of ports in router command
> line? [...]

 

   I've never looked on my D7000 (V1.0.1.78_1.0.1), so I know nothing,
but I'd guess that there is, if you can get in.  The first problem would
be that Netgear doesn't support any CLI access on its consumer-grade
routers, and recent firmware versions have disabled it on some models
where an unsupported scheme had previously enabled it.

 

   I don't know about an R6220 with your (undisclosed) firmware version,
but some models have a "debug.htm" page on the management web site which
has an option to enable Telnet access; others can be provoked using an
external program.  I use the program which I modified:
http://antinode.info/nte/ , but a Web search for terms like, say,
"Netgear Telnet enable" should find others.

 

   If you can find a way in, then it might be possible to puzzle out
where the "Show Statistics" page gets its values.

Message 2 of 7
Retired_Member
Not applicable

Re: How to tell what the negotiated link speed of the LAN ports are (in cli)?


If you can find a way in, then it might be possible to puzzle out
where the "Show Statistics" page gets its values.


I tried to do this before asking the question here on the form. Unfortunately, the grep command goes on forever and doesn't return anything meaningful. I am looking for e.g.

grep 1000M / tmp / * -r
grep 10000 / proc / * -r

I was hoping that someone here knows the location of the files where this data is entered. 🙂

 

Message 3 of 7
antinode
Guru

Re: How to tell what the negotiated link speed of the LAN ports are (in cli)?

> [...] Unfortunately, the grep command goes on forever and doesn't
> return anything meaningful. [...]

 

   _That_ (cheap and nasty) "grep" command might.  There could be things
under "/dev" (and perhaps FIFOs elsewhere) which simply return no data,
causing such a command to hang.  A more selective search might work
better.  For example:

 

   find / -xdev -type f -exec /sbin/grep 1000M {} \; -print

 

Around here, that found "ethctl" and "ethswctl".  See "ethctl", below.

 

> I was hoping that someone here knows the location of the files where
> this data is entered.

 

   Someone else might.  I managed to stumble into the /sys interface:

 

      ls -Ll /sys/class/net/eth*


For example:

 

# cat /sys/class/net/eth4/operstate
up

 

   Sadly, all the interesting bits failed:

 

# cat /sys/class/net/eth4/duplex
cat: read error: Invalid argument

 

# cat /sys/class/net/eth4/speed
cat: read error: Invalid argument

 

   Interestingly, "ifconfig" reports also lack these data.  For example:

# ifconfig eth2
eth2 Link encap:Ethernet HWaddr 50:6A:03:E9:AE:86 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:7085 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:1751635 (1.6 MiB)

   I assume that there's some subtlety (virtualness?)  in these entities
which hides the physical detail.  But I know nothing.

 

   One interesting fact which I gleaned while wasting too much time on
this was that on my D7000, "eth1" = "LAN4, ... "eth4" = "LAN1".

 

   I did also find ("find", that is) an "ethctl" command, and that seems
to provide the pay-off (at long last):

 

# ethctl eth1 media-type
Auto-negotiation enabled.
Link is down

 

# ethctl eth2 media-type
Auto-negotiation enabled.
The autonegotiated media type is 100baseTx-FD.

Link is up


# ethctl eth4 media-type
Auto-negotiation enabled.
The autonegotiated media type is 1000BT Full Duplex
Link is up


   Who could ask for more (other than consistent abbreviations)?

 

   That was educational.  Might also answer an old question about how to
fix the characteristics of an interface (and prevent Auto-negotiation).

 

   Until Netgear decides to disable all practical shell access, that is.

Message 4 of 7
antinode
Guru

Re: How to tell what the negotiated link speed of the LAN ports are (in cli)?

   Closer to a complete list:

 

# ethctl eth1 media-type   # NC
Auto-negotiation enabled.
Link is down

 

# ethctl eth2 media-type   # 10BaseT
Auto-negotiation enabled.
Link is up

 

# ethctl eth3 media-type   # 100BaseT
Auto-negotiation enabled.
The autonegotiated media type is 100baseTx-FD.
Link is up

 

# ethctl eth4 media-type   # 1000BaseT
Auto-negotiation enabled.
The autonegotiated media type is 1000BT Full Duplex
Link is up

Message 5 of 7
DragoDuII
Aspirant

Re: How to tell what the negotiated link speed of the LAN ports are (in cli)?

I had to delete my old account and create a new one.
@antinode thx for investigating, but unfortunately my router has worst OS.
My WAN port is eth3:

# cat /sys/class/net/eth3/operstate
unknown
# cat /sys/class/net/eth3/speed
cat: read error: Invalid argument

 
So its look like OS is not aware of "operstate" of interface. Maybe only Netgear app can read those values.
 

> nasty) "grep" command might. 
Unfortunately, the corrected grep does not see anything that could lead me to the trail.
 
> Around here, that found "ethctl" and "ethswctl". See "ethctl", below.
I don't have "ethctl" nether "ethswctl" command.
 
> Interestingly, "ifconfig" reports also lack these data. For example:
Is far i know "ifconfig" get data from "/proc".
 
My setup is:

# cat /tmp/etc/version
V1.1.0.106_1.0.1
# uname -ar
Linux R6220 2.6.36 #2 SMP Wed Dec 2 11:45:31 CST 2020 mips unknown
# sh --help
BusyBox v1.12.1 (2020-11-26 15:15:15 CST) multi-call binary


 
Any others ideas? 🙂

Model: R6220|AC1200 Smart WiFi Router with External Antennas
Message 6 of 7
antinode
Guru

Re: How to tell what the negotiated link speed of the LAN ports are (in cli)?

> So its look like OS is not aware of "operstate" of interface. Maybe
> only Netgear app can read those values.

 

   Any "Netgear app" must get its data from something in the OS.

 

   I don't have an R6220, so I know nothing.

 

> Unfortunately, the corrected grep does not see anything that could
> lead me to the trail.

 

   Look for "1000" instead of 1000M"?  Look at the HTML and/or
JavaScript for clues?

Message 7 of 7
Top Contributors
Discussion stats
  • 6 replies
  • 2105 views
  • 0 kudos
  • 3 in conversation
Announcements

Orbi WiFi 7