LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Detecting the external IP address of an internal network: (https://www.linuxquestions.org/questions/linux-newbie-8/detecting-the-external-ip-address-of-an-internal-network-205197/)

JohnLocke 07-21-2004 08:27 PM

Ok, I figured out part of the first question:
Answer: Locke is an idiot ...

I was accessing serverinfo.php from my windows box on the web browser while using SSH to access serverinfo.php from my linux box with the curl statement. So REMOTE_ADDR is the right variable and I now understand why.

acummings 07-21-2004 11:43 PM

Quote:

Originally posted by JohnLocke
[ snip ]
Question 2:

Now I've got this working ... what should I be looking at to create something that will either
a) ftp a file to my static IP containing my dynamic IP that I've just received
b) write to a file on that static IP site (btw, controlled by someone else ... I simply have ftp access)

Another phrasing of that question: is there a way to hard code an ftp transfer of a file? I could make a script that opens ftp at the correct address ... but once ftp is open, I don't know how to use a script to write in password and username or the file transfer "put" process.
Perl LWP or thereabouts in Perl can do the likes of that. I'm not advanced enough so as to know how to do what you want though.

ip update client

http://www.google.com/search?hl=en&l...rl&btnG=Search

Don't have to be written in Perl though. I came across some written in C language, for instance.

http://www.novajo.ca/easydns.html

A freely avail one written in Perl. Perhaps look at its source code for howto ideas?

http://www.dnsexit.com/Direct.sv?cmd=ipClients

more of 'em.

Which dyn dns service do you subscribe to? as, if ya haven't, ya might check there too.

I'd put money on it that differences of how it's done exist as far as the updater from one to another for instance no-ip.com versus dyndns
--

I've been wanting a static IP for some time now. But haven't leapt into it, not yet.

I'd be curious to hear your experience. Gotta have/subscribe to one of them dyn dns services, right? Like no-ip.com or dyndns or ?

I get confused when I go to look at all of their web sites. They range from free on up in price. Free could have ads in some way.

Rather than me make all the mistakes -- I'd like to benefit from someone been down that road. Web site helpful on it etc.?

Thanks. Alan.

JohnLocke 07-22-2004 04:08 PM

She is solved and working!

So others can know what I did ... here it is:

First I created a script that I called "serverinfo.php" and uploaded that to my static IP server:
Code:

<?php
echo $_SERVER["REMOTE_ADDR"];
?>

I next created an ftp script of events, called "ftp.scr":
Code:

put /var/www/scripts/dynIP.txt htdocs/dynIP.txt
bye

Lastly, I created a script, "serverpop.sh":
Code:

#!/bin/sh
curl -s http://www.ralinventions.com/serverinfo.php > dynIP.txt
cat ftp.scr | ftp ftp02.powweb.com > /dev/null

(yes, that's my current static IP, and yes, the website is currently a hack job ... give it time, I'm just starting. I needed /something/ to hold the domain! The full site should be up by the end of next month ... a cool preview is at www.ralinventions.com/ral.wmv ... but it's big)

and then added:
Code:

ln -s /var/www/scripts/serverpop.sh /etc/cron.hourly/serverpop.sh
Done! I now have a text file that is uploaded to my server containing my dynamic IP on my local server. Now I can use this as a web storage medium in the least.

Thanks to everyone that was so much help in pointing me to what I needed to learn!

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

acummings / Alan ... as to which service I'm subscribed to, I use (as you can see above) PowWeb. Located conveniently at www.powweb.com. They've given us (I'm going to approximate as I don't remember exactly) 1Gb of space, a rediculously large amount of bandwidth to use, about 120 pop email addresses with smtp enabled for another 300 or so. The server can use apache, php, sql, as well as standards now like j and javascript, html/xml, cgi. Unlike the free servers, you're free to do what you like with it (and there's no adds). You can (and we do) have sections up that aren't linked anywhere on your site ... even host multiple sites under the same domain but with separate starting pages.

The only thing I've run into so far that I don't like is they don't use sftp ... which would have made my ftp question trivial. But ftp will work fine for the limited amount of file moving I need to do.

BTW, they give credit for references, so if you look at this one and decide you like it, mention my domain as a reference and we'll get a couple bucks in our account ;)


All times are GMT -5. The time now is 05:43 AM.