show number of mac addresses on each port
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 5 Apr 2018 07:33:18 +0000 (09:33 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 5 Apr 2018 07:33:18 +0000 (09:33 +0200)
Usful for finding uplink ports

mac-by-port.sh [new file with mode: 0755]

diff --git a/mac-by-port.sh b/mac-by-port.sh
new file mode 100755 (executable)
index 0000000..c1f3e2f
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+grep : log/*bridge* | awk '{ print $1 " " $6 }' | sed -e 's,^.*/,,' -e 's/_/  /' -e 's/_[a-z]* /\t/' | sort | uniq -c