diff --git a/src/vnet/interface/monitor.c b/src/vnet/interface/monitor.c
new file mode 100644
index 0000000..6d79154
--- /dev/null
+++ b/src/vnet/interface/monitor.c
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2021 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <vnet/vnet.h>
+#include <vlib/vlib.h>
+
+static clib_error_t *
+monitor_interface_command_fn (vlib_main_t *vm, unformat_input_t *input,
+			      vlib_cli_command_t *cmd)
+{
+  const vnet_main_t *vnm = vnet_get_main ();
+  const vlib_combined_counter_main_t *counters =
+    vnm->interface_main.combined_sw_if_counters;
+  f64 refresh_interval = 1.0;
+  u32 refresh_count = ~0;
+  clib_error_t *error = 0;
+  vlib_counter_t vrx[2], vtx[2];
+  f64 ts[2];
+  u32 hw_if_index = ~0;
+  u8 spin = 0;
+
+  while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (input, "%U", unformat_vnet_hw_interface, vnm,
+		    &hw_if_index))
+	;
+      else if (unformat (input, "interval %f", &refresh_interval))
+	;
+      else if (unformat (input, "count %u", &refresh_count))
+	;
+      else
+	{
+	  error = clib_error_return (0, "unknown input `%U'",
+				     format_unformat_error, input);
+	  goto done;
+	}
+    }
+
+  if (hw_if_index == ~0)
+    {
+      error = clib_error_return (0, "no interface passed");
+      goto done;
+    }
+
+  vlib_get_combined_counter (counters + VNET_INTERFACE_COUNTER_RX, hw_if_index,
+			     &vrx[spin]);
+  vlib_get_combined_counter (counters + VNET_INTERFACE_COUNTER_TX, hw_if_index,
+			     &vtx[spin]);
+  ts[spin] = vlib_time_now (vm);
+
+  while (refresh_count--)
+    {
+      f64 sleep_interval, tsd;
+
+      while (((sleep_interval =
+		 ts[spin] + refresh_interval - vlib_time_now (vm)) > 0.0))
+	{
+	  uword event_type, *event_data = 0;
+	  vlib_process_wait_for_event_or_clock (vm, sleep_interval);
+	  event_type = vlib_process_get_events (vm, &event_data);
+	  switch (event_type)
+	    {
+	    case ~0: /* no events => timeout */
+	      break;
+	    default:
+	      /* someone pressed a key, abort */
+	      vlib_cli_output (vm, "Aborted due to a keypress.");
+	      goto done;
+	    }
+	  vec_free (event_data);
+	}
+      spin ^= 1;
+      vlib_get_combined_counter (counters + VNET_INTERFACE_COUNTER_RX,
+				 hw_if_index, &vrx[spin]);
+      vlib_get_combined_counter (counters + VNET_INTERFACE_COUNTER_TX,
+				 hw_if_index, &vtx[spin]);
+      ts[spin] = vlib_time_now (vm);
+
+      tsd = ts[spin] - ts[spin ^ 1];
+      vlib_cli_output (
+	vm, "rx: %Upps %Ubps tx: %Upps %Ubps%c", format_base10,
+	(u32) ((vrx[spin].packets - vrx[spin ^ 1].packets) / tsd),
+	format_base10, (u32) ((vrx[spin].bytes - vrx[spin ^ 1].bytes) / tsd),
+	format_base10,
+	(u32) ((vtx[spin].packets - vtx[spin ^ 1].packets) / tsd),
+	format_base10, (u32) ((vtx[spin].bytes - vtx[spin ^ 1].bytes) / tsd));
+    }
+
+done:
+  return error;
+}
+
+VLIB_CLI_COMMAND (monitor_interface_command, static) = {
+  .path = "monitor interface",
+  .short_help =
+    "monitor interface <interface> [interval <intv>] [count <count>]",
+  .function = monitor_interface_command_fn,
+  .is_mp_safe = 1,
+};
+
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
+ */
