Where is the ISP Router IP port forwarding set?

Started by Hacker007, January 18, 2016, 07:11:11 PM

Hacker007

Hi All.  I am using V7 of the Pi Gateway that Felix published at the end of 2015.  On the previous version of the image, I remember seeing a configuration file where the IP Address that points to the router that is connected to my ISP is set.  However, I have not been able to find such file under V7.  Where is this file located?  Thanks a million.

Felix

There is no such IP anywhere. Your Pi's IP is set via DHCP by your router so you don't need to worry about your IP.
To find out your external IP you just go to http://www.whatismyip.com

Perhaps you saw the CT50 thermostat IP setting which was hardcoded to an internal LAN ip, but that's just as a sample.

Hacker007

Thanks, Felix.  I know that the Pi gets it's IP address (as well as any other host on my network) from the DHCP server located in my router.  What I cannot find is the file where I need to enter the IP address of my router (in this case an ActioneTech Router connected to FiOS and then Verizon) so that the proxy can work.  I have been unable to locate the file where this external IP address is specified so that it can be used by your Gateway.  I am also not able to locate the .htpasswd file where I entered the login credentials for your gateway.  I got this working several days ago because , even today, I can see the data from my MotionMote over my WiFi network from my phone or laptop (as long as I provide the credentials).  Today, I am just trying to see data from my MotionMote but over the Cell network.  I guess it has been too many days and I cannot remember where I entered that date.  Sorry for the interruption and thank you for your help, Felix.

Felix

Like I said, there is no IP anywhere in settings.
If you follow the gateway guide, I mention that in order to forward your Pi www/socket traffic to the outer internet, you must setup your router port forwarding to forward the http and https ports to your internal Pi LAN  IP ports. That's it. Your Pi doesn't need to know anything about your external IP.

syrinxtech

Quote from: Hacker007 on January 18, 2016, 09:19:50 PM
Thanks, Felix.  I know that the Pi gets it's IP address (as well as any other host on my network) from the DHCP server located in my router.  What I cannot find is the file where I need to enter the IP address of my router (in this case an ActioneTech Router connected to FiOS and then Verizon) so that the proxy can work.  I have been unable to locate the file where this external IP address is specified so that it can be used by your Gateway.  I am also not able to locate the .htpasswd file where I entered the login credentials for your gateway.  I got this working several days ago because , even today, I can see the data from my MotionMote over my WiFi network from my phone or laptop (as long as I provide the credentials).  Today, I am just trying to see data from my MotionMote but over the Cell network.  I guess it has been too many days and I cannot remember where I entered that date.  Sorry for the interruption and thank you for your help, Felix.

Normally, the end node also gets it's default gateway (router) IP address from the DHCP server.  You can try:

netstat -r

on the PI and see if you have a default route/gateway.

You should find the .htpasswd file here:

/home/pi/gateway/data/secure/.htpasswd

Just a reminder, the "." in the filename means it's a hidden file in Unix/Linux.  If you just type "ls" you won't see this file.  You need to type "ls -A" to see hidden files.


Hacker007

Thanks for your help with the .htpasswd file.  The problem was that I was trying to view a file list using the File Manager and had forgotten that I had done an ls -al from the console on a previous occasion.  I am good to go with the password file.  Now, I understand what is going on with that.

Hi Felix,  could you please look the image below over to see what I am doing wrong in my Router's Port Forwarding settings? Thank you.


Felix

My router UI is different but this looks good to me, you're forwarding the right ports at least.

Felix

Sorry but not sure how to help, it looks like you're doing the right thing.
FWIW you should probably not post your public IP here!

syrinxtech

#8
Quote from: Hacker007 on January 19, 2016, 07:40:48 PM
Thanks for your help with the .htpasswd file.  The problem was that I was trying to view a file list using the File Manager and had forgotten that I had done an ls -al from the console on a previous occasion.  I am good to go with the password file.  Now, I understand what is going on with that.

Hi Felix,  could you please look the image below over to see what I am doing wrong in my Router's Port Forwarding settings? Thank you.

I've never used your UI or product, but it seems like you don't want the source port hardcoded to be either 80 or 443.  Yes, the destination port will be 80 or 443 but the source port coming in from the client's browser will be ephemeral (> 1023 and <= 65535).  Look at the attachment and notice the rule for the FIOS that says "Tcp Any  -> 4567".  This means "any" TCP source port will be redirected to destination TCP port 4567. 

I think you want something similar to the following:

Tcp any -> 80
Tcp any -> 443


Or am I missing something different in your UI?

Felix

Actually I think the ports should be specifically set, HTTP is port 80 and HTTPS is 443.

Hacker007

That's it.  HTTP port 80 and HTTPS port 443.  It works!!!  WooHoo!  Thank you, Felix and syrinxtech.

syrinxtech

Quote from: Hacker007 on January 20, 2016, 09:19:22 PM
That's it.  HTTP port 80 and HTTPS port 443.  It works!!!  WooHoo!  Thank you, Felix and syrinxtech.

So, if you hide your external IP, can you show us what the new mappings look like, it might help other folks in the future?

Hacker007

Here you go.  I hope it helps someone who might have the same problem.  ISP = Verizon FiOS.

Regards.

syrinxtech

Quote from: Hacker007 on January 21, 2016, 12:12:26 AM
Here you go.  I hope it helps someone who might have the same problem.  ISP = Verizon FiOS.

Regards.

Thanks for the upload Hacker007.