NoBlameNetwork
May 16, 2019
19 views
1 min read
Just a helpful tip for those annoying translations between the Linux MAC Formats (DE:AD:BE:EF:CA:FE) and the Cisco MAC Formats (dead.beef.cafe).
Grabbing the ARP table normally looks like this:
You can pipe in the ‘sed’ (stream editor) command to remove the colons and replace them with periods every 4 characters instead, and use the ‘tr’ (translator) command to change the case from upper to lower:
You can of course still grep after the sed and tr commands to provide specific outputs:
Grabbing the ARP table normally looks like this:
arp -an | grep -vi 'incomplete'
You can pipe in the ‘sed’ (stream editor) command to remove the colons and replace them with periods every 4 characters instead, and use the ‘tr’ (translator) command to change the case from upper to lower:
arp -an | sed -e 's/\(..\):\(..\)/\1\2/g' | tr ':[:upper:]' '.[:lower:]'
Now you can copy the output for use in Cisco devices.
arp -an | sed -e 's/\(..\):\(..\)/\1\2/g' | tr ':[:upper:]' '.[:lower:]' | grep 10.10.83.159
SecureCRT Button
If
you’re lazy (or efficient) like me, you’ll just add this to your button bar in
SecureCRT, and you’ll need to use double up on the backslashes ‘\’ as a single
backslash is seen as an escape character. arp -an | sed -e 's/\\(..\\):\\(..\\)/\\1\\2/g' | tr ':[:upper:]' '.[:lower:]'
All
Tags:
Linux
Found it useful, spotted a mistake, or done it differently? Start a thread. The link and title are filled in for you; Reddit will ask you to confirm before it posts.


