NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
Retired_Member
Jan 01, 2021How 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 (...
antinode
Jan 01, 2021Guru
> [...] 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.
- Retired_MemberJan 01, 2021
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. :)
- antinodeJan 01, 2021Guru
> [...] 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
upSadly, 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 argumentInterestingly, "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.
- antinodeJan 02, 2021Guru
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