Tech Journal Back to Tech Journal

How can I get the IP address of ppp0?

Here are two ways:

INETIP=$(/sbin/ifconfig ppp0 | grep addr | sed -e "s/          inet addr:\(.*\) P\(.*\)/\1/")
INETIP=$(/sbin/ifconfig ppp0 |tr ':' ' ' | awk '/inet addr/ { print $3 }')
Last updated on 2007-05-07 08:04:27 -0800, by Shalom Craimer

Back to Tech Journal