Friday, January 05, 2007

How to Check for Network Interface Information

Often I'm asked for IP information. If I don't know it from the top of my head, I will use the ifconfig command to ascertain it. This command gives you interface type, Internet Protocol address (IP), netmask, and broadcast address.

#ifconfig -a (the -a gives a verbose output of this command)

Obtain only the IPs
#ifconfig -a | grep inet | awk '{print $2}'

No comments: