Dynamic dns & private IP
-
Dear All.
Please forgive this newbie…I'm using no-ip and have it logging in and updating its IP, it was all working fine until I changed ISP's away from the local cable company that provides a modem and passes the public IP to the WAN i/f on the pfsense box.
The new ADSL router its self has the public IP and forwards all traffic to an internal DMZ IP configured, this means that a private IP is given to pfsense and pfsense then logs into no-ip and updates with this private IP.
I'm sure there is a way to get pfsense to find out what the public IP is and when it updates no-ip it gives that instead of the 192.168.1.1 IP the WAN interface has gotten from the ADSL router. ?? the ADSL router (TPLINK) doesnt have a transparent mode I can find to pass on the public IP, I tried another ADSL router and the ISP will not allow it on their network - it simply will not work even though I have all the details set correctly, their support says they only allow these TPLink devices connected to their service.
constructive ideas ? - (I'm ties into this ISP for another year now - so that is not an option to bin them and change.)
thanks.
-
See http://forum.pfsense.org/index.php/topic,17175.0.html for a patch to the Fit123 package for pSense 1.2.3 The patch gets the public IP address from a web page rather than the WAN interface.
-
HI,
thanks for the info: I dont have the fit123 package installed - but I did try the php script on another machine and that simply returned the private IP of the NIC connected to the router.I'm not sure this is my solution,
-
HI,
thanks for the info: I dont have the fit123 package installed - but I did try the php script on another machine and that simply returned the private IP of the NIC connected to the router.I'm not sure this is my solution,
Thats interesting. Can you provide the php script you are using? The script I posted gets the IP address displayed by the web server at http://myip.dnsomatic.com If you point a web browser at http://myip.dnsomatic.com it should display the public IP address of your network. The php script should display the same IP address. If the php script displays a private address it suggests you are running a different script OR (unlikely?) you can access myip.dnsomatic.com by a private IP address in which case you would need to use a different web server to get your public IP address.
Here's what happens if I run the script on my gateway:
/usr/local/bin/php /usr/local/pkg/Fit123/ddns/getip.php
Content-type: text/html
xxx
203.144.23.118The IP address of my WAN interface is 192.168.xxx.yyy
-
cromer:/var# php getip.php
Content-type: text/html192.168.0.212cromer:/var#
this is the php script,
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://myip.dnsomatic.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_MUTE, true);
$html = curl_exec($ch);
curl_close($ch);
echo $html;
?>my wan interface on the pfsense box is 192.168.0.212 my public IP really is 86.11.x.x quiet a bit different.
I also dont have the Fit123 package installed, what does that give me I dont already have? -
The script you posted displays the IP address displayed by the web server myip.dnsomatic.com. It doesn't make sense to me that the public web server myip.dnsomatic.com receives a connection from a private IP address and returns a response to that private IP address. Something is wrong with this picture!
Maybe your php command isn't executing the script you think it is. Do you get the same result if you specify the full path to the getip.php script in the php command?
Maybe your DNS is returning a different IP address for myip.dnsomatic.com from what I get on my system. If the correct getip.php script is being executed then it would appear your system thinks myip.dnsomatic.com is on the pfSense's WAN subnet - your TP-LINK router trying to be helpful? What do you get from the shell command: ping -c 1 myip.dnsomatic.com
On my system I see:
$ ping -c 1 myip.dnsomatic.com
PING updates.dnsomatic.com (208.69.38.210) 56(84) bytes of data.
64 bytes from 208.69.38.210: icmp_seq=1 ttl=50 time=204 ms–- updates.dnsomatic.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 204.111/204.111/204.111/0.000 ms
$