* Para saber la IP con la que navegamos por Internet (siempre que el servicio http://www.whatismyip.org/ este activo):
wget -O - -q http://www.whatismyip.org/ | grep ""
* Para saber la IP de tu interfaz de red eth0, en Ubuntu 9.10 en español:
/sbin/ifconfig eth0 | grep "Direc. inet" | awk '{print $2}' | cut -c 6-
o tambien
/sbin/ifconfig eth0 | grep "Direc. inet" | cut -f2 -d:|cut -f1 -d' '
Referencia: http://enrique.barbeito.org/blog/una-funcin-para-extraccin-de-tu-ip-en-internet/
Deja un comentario