• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

IP address

jwinter1

Junior Member
Is there a way I can find out my IP address on my desktop at home from somewher else? My current situation is that I'm running Apache/PHP/Perl on my DHCP DSL connection. I'm looking for a way that I can find out that server's address remotely. Any ideas?
 
You may want to look into getting a dynamic dns service that will allow you to update a hostname automatically with your IP. Several such services include dyndns.org and dhs.org...much more has been posted about them in Networking, if you want to search...

~Ladi
 
Well, you can easily write a shell script to email you your IP every hour if you wanted. It could look something like this:

----------------------------------------------------------------

#!/bin/sh

PATH=/sbin:/bin:/usr/sbin:/usr/bin

extip=`/sbin/ifconfig eth0 | grep 'inet addr' | awk '{print $2}' | sed -e's/.*://'`

#Print the result of the variable to a file as you can only redirect text into the body of a message with mutt (I'm probably missing something stupid here though).

printf $extip > /home/<your directory>/mydynip

/usr/bin/mutt -s &quot;Your Current IP&quot; <your email addy> < /home/<your directory/mydynip

rm -rf mydynip
----------------------------------------------------------------------

Then just make it a cron job that runs every hour. Make sure you substitue whatever your outside interface is appropriately otherwise you won't get the correct IP.

Also, I used mutt here as it's my preferred MUA. However, you could easily use mailx, Pine, Elm, or even sendmail directly if you're running that. The syntax will differ a bit though.

Finally notice that I've encased the ENTIRE statement after extip= in BACK ticks. Why? Because I want the result of that mess to be assigned to the variable. Make sure the file is executable and you're done.
 
/sbin/ifconfig eth0 | grep 'inet addr' | cut -f2 -d ':' | cut -f1 -d ' '

Use that instead. No need to call up awk and sed for this small operation. Sorry. That's a much system friendlier way to accomplish the same thing as my previous line.
 
I'm with Ladi on this one. Dynamic DNS is the way to go. Currently I'm using dyndns.org and the clients check for IP changes every 5-10(whatever you set it to) minutes if there's changes then it'll update DNS automatically.
 
Thanks for the rapid response. I've set up an account with dyndns.org and I have installed yiPost as the little client that updates the DNS settings at dyndns. So far, so good.
thanks again
 
What ever that is you have posted Damaged it sure looks cool 🙂 If I had a clue on how to due it I would give it a shot! 😀
 
heh. vi_edit is giving you a hint. Though I personally don't use vi or any vi variant (e.g. ViM) any text editor will do. BTW I use jed, which is an emacs variant. Why? Because that's what I was taught. I really should learn to cope with vi though.

Finally make sure you don't forget the magic first line (#!/bin/sh) and make sure that the file is exectuable. BTW I learned to pronounce that first line as sh-bang. 🙂 Have fun! Shell scripting is your easiest way to program, imho.
 
Back
Top