You can enable detailed port statistics via the command-line interface (CLI) on switches in the Netgear M4200/M4300 family. I will explain how to set up a time range and port group, and apply them to a port or range of ports to gather throughput data. This post will make up for some shortcomings in Netgear’s CLI documentation about enabling and gathering switching statistics.
NOTE: you must enter commands enable
and configure
to enter administrative configuration mode prior to setting a time range or port statistics.
Setting a Time Range on the Netgear CLI
Time ranges are used by several other Netgear commands, but they are (barely) documented only in one section (Time Range Commands for Time-Based ACLs in document M4200-M4300_CLI_EN.pdf). No examples are given for the time-range
command, so you have to guess at the date format. Surprise, the month has to be a three-letter abbreviation instead of an integer! If you guess wrong and try to use an integer month, you get the helpful error message: Value of starting month is incorrect
. Here’s the correct date format:
(M4300-24X) (Config)#time-range afternoon-2021-01-18
(M4300-24X) (config-time-range)#absolute start 13:00 18 Jan 2021 end 18:00 18 Jan 2021
(M4300-24X) (config-time-range)#exit
(M4300-24X) (Config)#show time-range
Admin mode: Enabled
Current number of all Time Ranges: 1
Maximum number of all Time Ranges: 100
Periodic
Time Range Name Status Entry count Absolute Entry
------------------------------- -------- ----------- --------------
afternoon-2021-01-18 Inactive 0 Exists
(M4300-24X) (Config)#show time-range afternoon-2021-01-18
Time Range Name................................ afternoon-2021-01-18
Time Range Status.............................. Inactive
Entry Number: 1
Absolute Start Time............................ 13:00 18 Jan 2021
Absolute End Time.............................. 18:00 18 Jan 2021
No Periodic time entries have been configured for this Time Range.
Add a Port Statistics Group
You’re not exactly adding a group…you have to configure one of the seven existing groups described in the table of the section called “Statistics Application Commands.” You configure the group to use a specific time range and reporting method, and then add the stats group to one or more interfaces (port, port range, or LAGs). In my example below, the final show
command reports no data, because the reporting period has not yet concluded.
(M4300-24X) (Config)#stats group port-utilization timerange afternoon-2021-01-18 reporting console
(M4300-24X) (Config)#interface 1/0/1-2/0/24
(M4300-24X) (Interface 1/0/1-2/0/24)#stats group port-utilization
(M4300-24X) (Interface 1/0/1-2/0/24)#exit
M4300-24X) (Config)#interface 1/0/1-2/0/24
(M4300-24X) (Interface 1/0/1-2/0/24)#stats group port-utilization
(M4300-24X) (Interface 1/0/1-2/0/24)#exit
(M4300-24X) (Config)#show stats group port-utilization
Group: port-utilization
Time Range: afternoon-2021-01-18
Interface List
--------------
1/0/1 - 1/0/24, 2/0/1 - 2/0/24
Interface Utilization(%)
--------- -----------
Conclusions
The Netgear M4200/M4300 family of switches is an interesting product line. It’s not quite enterprise-grade hardware like a Cisco or Aruba switch, but it has a lot of the same features and very good performance at a much lower price. We’ve had several of these switches running in light-duty data center applications for more than two years, and they have been very reliable. You can configure the switch’s main features via the web user interface, but you have to go to the command line interface (CLI) to access the most powerful features. If you are using Netgear’s web interface, be sure to see my recent post about how to install a valid SSL/TLS certificate on a Netgear M4200/4300 switch.