Skip to content

Instantly share code, notes, and snippets.

@subfission
Last active July 28, 2020 23:15
Show Gist options
  • Save subfission/760d82ef8071a26b7076d2b21d33b349 to your computer and use it in GitHub Desktop.
Save subfission/760d82ef8071a26b7076d2b21d33b349 to your computer and use it in GitHub Desktop.
Grab ethernet from host with single NIC.

Methods

Method 1

ifconfig | grep -Po 'ether \s*\K\S*'

Method 2

cat /sys/class/net/eth0/address
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment