The WiFi Router of your LAN has an external IP address which it uses to communicate with the internet, let's take a look at how to find. You can obtain the IP by querying Google with this url
https://www.google.com/search?q=my+ip
The result should be something like 80.76.56.11
Now get the local LAN IP address assigned to your Raspberry Pi by typing this command in the terminal window:
ifconfig
On the resulting text, you find the IP address after "inet addr:" for example 192.168.1.6
Configure the WiFi Router
- connect using browser to http://192.168.1.1/ (the default address of your router) and then log in by using your router's user name and password.
- search "Port Forwarding" section (Port Forwarding is the ability to open ports in your router and re-direct data through those ports to a single PC on your network)
- give a name to the new rule (webserver). Type the Raspberry Pi LAN ip address. Choose the protocol as TCP. Type in external port 80 (the port number available for Internet connections) and internal 8080 (the port number for your webserver on the Raspberry Pi). Click on Add or Apply to save the rule.
Test the configuration by opening a browser from your PC o your smartphone and going to your public IP.
http://YourPublicIpAddress in this tutorial example for me is
http://80.76.56.11
If all is well, you should see the html hosted on your local Raspberry Pi appear in your browser.
0 comments:
Post a Comment