PDA

View Full Version : [SOLVED] What command can I use to determine the address by ISP allocates to me?



bwallum
August 1st, 2011, 11:34 PM
In the terminal, what command can I use to find out the current ip address that my ISP allocates to me from their server to my router?

nm_geo
August 1st, 2011, 11:48 PM
try this one


wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'

http://www.go2linux.org/what-is-my-public-ip-address-with-linux

bwallum
August 2nd, 2011, 12:17 AM
Hole in one! Thank you!

EDIT
Also found a script to automate the process using an alternative source, www.whatismyip.com:-

----------------------------------
#!/bin/bash
#
# From: http://ubuntuforums.org/showthread.php?t=526176
# echo Your external IP Address is:
wget http://automation.whatismyip.com/n09230945.asp -O - -o /dev/null
echo
exit 0