If we want access to our Raspberry Pi from outside our network, we need to do the following:
IP provided by the ISP are genteraly dynamic IP which changes after some time. In our cases we need to have static addresses which does not change occasionally.
Access our modem via the Ip address (gateway) and go to the port addressing part. Configure port 80 that points to our web server (put the IP address of our account), this IP address is the one that automatically assigns the DHCP server of our system.
Here we have some ports that can be forwarded from the modem-router:
To get the gateway IP address, type the ipconfig
command, you need to have admin rights. After this, type http://gatewayip_addres
in the web browser of your router.1
:
This is an example of what you'd see if you had a Linksys router, yours may be a different interface:
To open a port we need to configure our router to give permissions for entering from outside, so we need to give permission in our router:
This screenshot shows the final results, how to open a port number 3000, and the name of the application node:
We need to configure a domain name service so we can access our web server by typing the name of our domain (it is very difficult to learn the IP addresses of the web pages). That's why Domain Name Servers (DNS) were created. Follow the next section to create a domain.
You may want to access your IoT control panels away from home. In that case, your web server will need to become a host on the Internet.
This is not a straightforward thing since it's behind the router in your home. Your ISP generally does not give you a static public IP address because most users are simply accessing the web, not serving web pages.
Therefore, the public side of your router is given an IP address that can change from time to time. If you browse to <whatsmyip...>
, you will see what your public IP is currently.
Tomorrow it could be different. For setting up external access, you can do one of two things. If you want to simulate having a static IP, you can use a service such as Dynamic DNS. If you just want to "try out" external access, you can open a port on your router
Benefits of having Dynamic DNS:
18.219.42.240