1

I want to to get an external IP for my raspberry pi 2 on port 80. I am using a GRBL web page for CNC, so I want to get the web page online.

I tried to port forward Raspberry Pi 2 IP, but it doesn't work for me. My router is tp-link. I used 80 as both the external and internal ports in the router setting and entered the IP of Raspberry Pi.

I have read that the IP range from 192.168.0.100 to 192.168.255.255 and they don't have external IP addresses, is this true? my IP is 192.168.0.105.

1
  • How do you know the port forwarding is not working? Have you tried connecting to the hosted webpage from outside your LAN? Commented Aug 2, 2017 at 20:16

4 Answers 4

1

ISPs Block Port 80

Some Internet Service Providers (like Cox Communications) block port 80.

You may need to use a different port, like 8080. For example:

      Router         >>>     Rasberry Pi
93.184.216.34:8080   >>>   192.168.0.42:80
3
  • yes, you're right i just figure out that port 80 is blocked can you please tell me how to change it @Hydraxan14 Commented Aug 5, 2017 at 9:00
  • @BalsamQassem if your ISP is blocking port 80, you'll have to call them on the phone and ask them to unblock it. They might refuse, in which case you'll need to use a different port.
    – Hydraxan14
    Commented Aug 7, 2017 at 19:57
  • OK, i will call them Commented Aug 8, 2017 at 11:45
2

The Raspberry Pi won't be assigned an external looking IP. Your router, which is given an external IP address via your externally facing modem, passes any traffic on port 80 to the appropriate internal IP address.

1

The range you're mentioning are private IP addresses (for local network only)

You can verify the raspberry private IP with the ifconfig command, and verify if the port 80 is really open and listening with a browser by going to that IP.

If you configured the port forwarding correctly in your router, every request made to your router's public IP will be forwarded to the private IP you set, in this case, your raspberry's. and then you can access it from outside the local network.

To find out your router's IP you can use a website like ipchicken to know your public IP, but have in mind that most ISP dynamically change this, so a common solution is to install a dynamic DNS client to use with a NoIP account.

2
  • you can print all bound sockets and their PID with command netstat -tulpn although this requires that net-tools be installed. This way you can determine if the server is e.g. listening on localhost only, or has not bound a port.
    – crasic
    Commented Aug 3, 2017 at 3:19
  • i can't open any port i tried forwarding port 8080,8081,8082,8087 .and checked it in (on line port checker) but are all closed. what i have to do Commented Aug 5, 2017 at 16:15
1

The IP addresses you cite are indeed private addresses and exist only within the scope of your router/LAN. To allow access from outside, you may want to consider a dynamic domain name - freemium services like https://www.noip.com/ provide this. They also give pointers to help with port forwarding issues.

I have set up several RPis with NoIP domain names across a variety of LANs from academic to private, US to Asia, and all worked eventually. The only real challenge came with a commercial ISP in Japan. I had to resort to tools such as Zenmap and https://github.com/kaklakariada/portmapper (on MacOSX) to wrangle the router into allowing external access to the usual ports (80, 8080 for web pages, 5900 for VNC, 22 for ssh).

NoIP's solution is to: (1) provide you with a domain name; (2) have you install a little daemon that runs on your RPi. This daemon periodically communicates its location to the NoIP hub, which then keeps the DNS up to date with that address.

There are likely other dynamic domain name alternative services out there. This one is free, but at the cost of having to regularly confirm, by hand, that you still want to keep using the DN and the service.

1
  • i can't open any port i tried forwarding port 8080,8081,8082,8087 .and checked it in (on line port checker) but are all closed. what i have to do Commented Aug 5, 2017 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.