Need help in port forwarding webserver from my rpi to external ip - webserver

I need help port forwarding my webserver from my local ip to external ip.
I have already tried setting up rules in my router for port 8080 (this is the current port for local ip as well (http://localhost:8080)) (Image Attached)
I am using Huawei Router: HG8145V5
I cannot access the webpage from my external ip it shows site cant be reached took too long to respond.
I'm sure its something wrong or extra needed with the port forwarding but cannot find out why.
The webpage is running on apache2.
Port Forward Rules
Webpage Running on 192.168.1.13:8080

I just found out i needed to unable dmz in forwarding rules to enable networking port forwards.

Related

Can't find which port to use in port forwarding

I have a webserver with different IP address from my LAN.
webserver - 133.3.33.166
internal network ip (local host) - 192.168.1.10 (xampp)
I need to run an app online hosted in my localhost. Currently I am using ngrok link inside an HTML iframe tag in my webserver to access those apps inside my local server. After I installed SSL in my webserver, apps can not be access anymore. No error messages, only a blank white page in my browser.
I need to find what port I should use for port forwarding if it is possible. Thanks.
Tried some ports I found using netsh -ab. PLease help.

Issue getting my web server to work from external devices

I am attempting to set up an apache2 web server on my raspberry pi. I am able to connect to it by doing http://localhost:8080 (8080 because my router blocks port 80). Although when I do http://my.pub.lic.ip:8080 the connection times out. I set up port forwarding so that requests going to my router on port 8080 go to my raspberry pi on port 8080. This does not seem to work but I'm also not sure if the port forwarding is the cause or if it is something else. Any suggestions?
Is your web server configured to listen on the network interface besides localhost?
https://httpd.apache.org/docs/2.4/bind.html
For example, to make the server accept connections on both port 80 and port 8000, on all interfaces, use:
Listen 80
Listen 8000
To make the server accept connections on port 80 for one interface, and port 8000 on another, use
Listen 192.0.2.1:80
Listen 192.0.2.5:8000
You can try using nmap by finding your router's public IP and on the raspberry pi type nmap my.pub.lic.ip This will show you what services are actually being published to the world. This gives more insight to the problem.
I got the web server up and running although for some reason it appears that my isp would only allow it to be hosted securely (as an https page)(I'm not sure if that's the right way to phrase it). To achieve this for free, I used cloudflare's ssl service. A tutorial to set it up for apache2 can be found here

Mikrotik direct ip to server on subnet

Please, advice on how to set the public IP address/domain name for a web page to be forwarded to a specific server machine on a subnet (say, 192.168.1.77). Can this be done via Mikrotik GUI interface?
An outside IP or assigned domain do not do this automatically, Mikrotik doesn't pick up the server behind a subnet if one does not set the path to it. I've seen a couple of tutorials assigning a server IP address in Mikrotik terminal with "masquerade" command but wonder if this can be done via Mikrotik Webfig GUI.
You need 2 things:
dst-nat to WEBserver
Default route on WEBserver set to Mikroitk
/ip firewall nat add chain=dstnat dst-address=PUBL.IC.I.P dst-port=80 or 443 action=dst-nat to-addresses=192.168.1.77
You must disbale /ip service www and www-ssl for using port 80 or 443
If Mikrotik isn't default route to internet for WEBserver say to me and I will explain how to do
For testing if it's working, you must test by other connectiont outside your LAN ( maybe smartphone without wifi)

Can't connect to my webserver from external source

I am having problems connecting to my website from a source outside my local network. I had another server before running the same site. The only difference is the old one was FreeBSD and now I'm trying it on Linux.
Here is my setup: I'm using Apache2. The server is behind a Netgear router. I'm using a Freedns host name. I have ddclient updating my ip.
Here is what happens: I can look at my site from the server in Chrome or my phone connected to the local wifi. It works using either the host name or ip address. It does not load from my cell phone or from my desktop using a proxy for either the host name or the ip address (the external one from googling my ip and from the router's wan info page). When I try the proxy with the host name I get "conection timed out" error, and when I try the ip address I get "couldn't connect to host error".
Here is what I've tried: I enabled port forwarding to the server from and to port 80 to my lan ip address. I disabled the firewall on the server. I double checked that the host name is directed to the right ip address. I ensured that the ip address does indeed point to my router. I've watched wireshark on my server while trying to connect and don't see any incoming requests when I try to load it from my phone.
It seems like maybe my port forwarding isn't working, but on my router it says that that port forwarding rule is active.
I'm out of ideas as to why what else could be going wrong.

Connecting to Local Web Server when I am Outside my LAN

I have a web server running out of my home. I have assigned it an address such as 192.168.1.123 on port 80.
I understand that this is running on my local network. If I go to another computer on my network and type in the server's ip address, I can see the server.
Is there a way to access this server from outside my LAN?
Yes, you need to set your router to forward connections to port 80 to your internal IP address (192.168.1.123). Look for Port Forwarding on your router admin screen which I would imagine you access by going to http://192.168.1.1
Keep in mind that your ISP may block port 80 completely in which case you can run your web server on a different port (for example por 8180) and have your router forward connections to port 8180 to your internal IP.
To access your server from outside, you just need to point your browser to your external IP address which you can find out by going to http://www.ipchicken.com
Assuming you have a connection to the internet:
https://github.com/progrium/localtunnel
is a quick way to access your local server from the internet. There might be similar implementations in other languages/platforms. This is just the one I know about.
Remember that security issues need to be carefully considered when opening your local network to the world.
If you use a PHP Webserver you can set it this way:
php -S <YourIPAdresse>:<SomePortNumber> <StartPHPpage>
Example: „php -S 192.168.1.123:9000 index.php"