[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Command to see ip address on etch stable



On 2007-08-23 17:31:03 -0400, Orestes leal wrote:
> ifconfig eth0 | grep inet | awk '{ print $2 }'
> 
> Where eth0 it's your first network card, and so on.

Note that the Linux kernel doesn't specify what is your first network
card (e.g. upgrading the kernel can change the names of your network
cards). It's better to use the MAC address to select the IP address.
Moreover your command gives garbage when the machine has IPv6 support
(grep ' inet ' is better).

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)



Reply to: