Skip to content

Instantly share code, notes, and snippets.

@evanslai
Forked from PitBeast/brctl_show.sh
Created November 6, 2020 09:19
Show Gist options
  • Save evanslai/d47c8778ce6c88beebe8f65f8a5f8f7f to your computer and use it in GitHub Desktop.
Save evanslai/d47c8778ce6c88beebe8f65f8a5f8f7f to your computer and use it in GitHub Desktop.
brforward convertion
brctl_showmacs () {
cat /sys/class/net/$1/brforward > /tmp/brforward ;
printf "port no\tmac addr\t\tis local?\tageing timer\n" ;
hexdump -v -e '5/1 "%02x:" /1 "%02x" /1 " %x" /1 " %x" 1/4 " %i" 1/4 "\n"' /tmp/brforward | awk '{ islocal = $3 ? "yes" : "no" ; printf "%3i\t%s\t%s\t\t%8.2f\n",$2,$1,islocal,$4/100 } ' ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment