Koozali.org: home of the SME Server
Contribs.org Forums => General Discussion => Topic started by: gbentley on March 16, 2009, 01:39:34 PM
-
On sme's behind dynamic dsl is there a way to display the servers ip on the primary web page?
(dyndns is great but how to reveal new ip without logging in?)
-
You could just iframe this:
http://checkip.dyndns.org/
-
That only shows _your_ ip - not the servers ....
-
hi
what ip are you talking about? could you please clarify your setup and your needs?
thank you
Ciao
Stefano
-
gbentley
If you use the ddclient contrib to manage the dynamic IP, then it emails admin when the IP changes.
-
gbentley
If you use the ddclient contrib to manage the dynamic IP, then it emails admin when the IP changes.
Think ddclient only works in gateway mode - this is server only.
Neno - am talking about the ip address allocated by the adsl isp.
I have tried a few perl scripts but get error messages and am
not really up on perl enough to understand why.
-
gbentley
I'm pretty sure ddclient works in gateway & server or server only modes.
-
Either way, Im pretty happy with letting the router update Dyndns, and I can log into server manager using the hostname created on the dyndns account however to vpn you need to use the ip address and using dyndns doesnt reveal it.
Surely there must be a neat bit of perl / php etc to do this?
-
Traceroute is your friend.
Windows command - tracert FQDN
Linux command -traceroute FQDN
-
gbentley
....however to vpn you need to use the ip address...
What makes you say that ?
I VPN to a sme using hostname, on a dynamic IP & with dyndns hosts.
If WINS is configured correctly in all your VPN connections points, then your router should respond to the hostname domain.
-
gbentley
What makes you say that ?
Because when I tried to setup a pptp from XP using the hostname it didnt work.
I have just tried this again and now it works fine. Thanks Mary. Sorry list!
-
That only shows _your_ ip - not the servers ....
It should show the external (public) IP which is what you need to VPN in (unless I'm misunderstanding you).
-
It should show the external (public) IP which is what you need to VPN in (unless I'm misunderstanding you).
No, it only shows the referring ip
-
No, it only shows the referring ip
Try going to it from the server using links.
-
http://whatismyip.com/ will reveal your adsl WAN side IP address (IP address assigned by your ISP).
google "php screen scraper" to find script to extract this IP address from the web page.
thomasch
-
http://whatismyip.com/ will reveal your adsl WAN side IP address (IP address assigned by your ISP).
OK, the original question: I needed the sme webserver to display a page _that I can access remotely from another location_ - that will display the wan ip of the network that the sme is on - *not my* wan ip.
whatismyip etc wont help - and most php I have seen / tried only derives the referrers wan ip (ie the wan ip of the browser making that request)
I have also seen alot of other linux commands to derive the wan ip but this has to be done as root. Plus I am no coder so wouldnt even be able to attempt to write a Perl script that could write out to an html page on the fly!
However ... screen scraping this url http://dynupdate.no-ip.com/ip.php may be an
answer if I can figure out the right php - so thanks for that!
-
gbentley..
you could create a cron script that:
- call http://whatismyip.com/ or http://checkip.dyndns.org/ and download the page (something like wget http://checkip.dyndns.org/)
- grep the ip from html code
- then write the ip in a inclusion file that you can use in your page.. THAT ip will be, for sure, your WAN ip..
you could use perl regexp to grep ip from html, I've found some example googling a bit.
HTH
Ciao
Stefano
-
Thanks for answers etc ; from Thomas idea this works on my own 3bds server but not on sme - guess its to do with php setup ;
<?
$url = "http://dynupdate.no-ip.com/ip.php";
$raw = file_get_contents($url);
echo "{$raw}";
?>
Anyway, as Mary stated ; PuTTY, WinSCP and MS PPTP Client all work fine with DynDNS 'hostname' !
-
Thanks for answers etc ; from Thomas idea this works on my own 3bds server but not on sme - guess its to do with php setup ;
<?
$url = "http://dynupdate.no-ip.com/ip.php";
$raw = file_get_contents($url);
echo "{$raw}";
?>
Anyway, as Mary stated ; PuTTY, WinSCP and MS PPTP Client all work fine with DynDNS 'hostname' !
please use the "code" block.. otherwise part of your post will be invisible :)
EDIT: strange enough, now I can see your last sentence...
are you getting any error with php on SME?
Ciao
Stefano
any error reference?
-
No, just no output from php at all!
-
gbentley
..as Mary stated ; PuTTY, WinSCP and MS PPTP Client all work fine with DynDNS 'hostname' !
Yes the need to know the IP is no longer as VPN is now working.
Another approach (if using a gateway server) is to run a cron job eg
55,56,57,58,59,00 20 * * * root /sbin/e-smith/db configuration getprop ExternalInterface IPAddress
-
I create a "new" command on all new servers, it's something like this (from memory!):
--- /usr/bin/ipconfig ---
#/bin/bash
lynx --dump www.whatismyip.com |grep "Your IP is"
--- end of usr/bin/ipconfig ---
this should show you external IP address. Of course you can put this on a shell variable and use it on HTTP page. Google for help about this.
Jáder
-
Missed the easiest one yet ....
ping myhostname.dyndns.com
resolved ip
:)
-
How about this:
lynx --dump www.whatismyip.com/automation/n09230945.asp
This will out put the ip address directly.