0

i Have created a local web app hosted on my raspberry pi. I want to access the web app from outside so outside the local network. To do that, I have configured dmz and I have added my raspberry local ip address.

Now how can I get the raspberry public ip address?

I have tried to use the bash commands: curl checkip.amazonaws.com. But the ip address i get is the same as my computer

How can I solve it? how can i access the raspberry from outside?

P.S: I control my raspberry via ssh

thank you :)

pyChris
  • 1
  • 2
  • without info on your network topology I am just guessing. If you are behind a cable or dsl modem your entire local network will show the same public address in 99.99% of cases (only companies typically have more than 1 public address available. You will need to create a NAT rule in the modem/router to direct incoming traffic on that address on a certain port to the raspberry pi. And you will probably need a dynamic dns service to tie a hostname to that address as well. Nothing of this however is programming related, I suggest to hop over to superuser.com (another SE site). – fvu Jun 10 '22 at 08:59
  • my modem is a ewdsl modem. I have done some research on internet and I have seen that you can configure a dmz and add the ip address. I'm sorry, but I thought that was programming related. Thank you very much – pyChris Jun 10 '22 at 09:09

1 Answers1

0

Your public address is the same for every device on your network because it's the IP address devices OUTSIDE of your local network see as illustrated by this quick diagram I've made.

enter image description here

If you want to access your local webserver you need to tell your router to forward requests to a given port to a local network address. So assuming your webserver is running on port 80 you need to tell your router to forward requests to 192.168.1.50 (assuming your RPi local address matches the diagram's)

Some random IT boy
  • 7,569
  • 2
  • 21
  • 47