A useful script for gaining information about your Ethernet adapter.

Posted: August 7, 2014. At: 11:01 AM. This was 3 years ago. Post ID: 7608
Page permalink: http://securitronlinux.com/debian-testing/a-useful-script-for-gaining-information-about-your-ethernet-adapter/

Now, we must convince Congress to stop the FCC. Can you display an alert?

This useful shell script will print information about your Ethernet or Wireless adapter. This is very useful for getting a lot of information at once.

#!/bin/sh
 
DEV="eno16777736"
 
echo "Showing information for the active network interface: $DEV."
 
echo -e "-*- \e[1mGet timestamping information for your Ethernet device.\e[0m -*-"
echo
 
ethtool -T $DEV
 
echo -e "-*- \e[1mPrinting main information about the Ethernet device.\e[0m -*-"
echo
 
ethtool $DEV
 
echo -e "-*- \e[1mPrinting out the permanent hardware address.\e[0m -*-"
 
ethtool -P $DEV
 
echo
echo
 
echo -e "-*- \e[1mPrinting Ethernet adapter IP address.\e[0m -*-"
 
# This tip from: http://unix.stackexchange.com/questions/103241/how-to-use-ifconfig-to-show-active-interface-only
 
ifconfig | grep "inet " | grep -v 127.0.0.1 | sed -e 's/Bcast//' | cut -d: -f2

This script uses the ethtool command. This is very good for gaining IP address info as well as other useful information.

No comments have been made. Use this form to start the conversation :)

Leave a Reply