-2

local connection

Nmap scan of public ip address

Open Port Check Tool result

Virtual server configuration

I have a linux machine on a dekstop with arch linux installed that I use as a server running Apache2 (it works perfectly fine locally), and I want to use port forwarding to access it from the public ip address.

I tried using the router's virtual server service, so I redirected my local to port 2112 of my public ip address, I already used http://www.portchecktool.com/ to scan the port, and it says that the port is open whenever I enable it (I tried changing the port number many times, 443, 22, 5555...). But when I try to connect, it says 'Unable to connect'. (Even thought the port scanner tool says the port is open on my public ip, when I scan my router's port with nmap it says it's closed)

I know I didn't provide many details, but is there something that I'm missing ?

EDIT:

It seems that the problem only occurs locally, which is why the nmap and port checker results are different, I asked a friend of mine to connect to my public ip address on port 2112, and he told me that it's working fine, and that he could see the page, why does this problem occur ? Why can I access it from outside LAN but not from the inside ?

1 Answers1

0

There are a few parts to this answer:

To keep it simple I am going to assume a few things as you did not specify too many things.

What you have

Ubuntu Server VM running on your Windows machine

What you are trying to do

Connect to the VM (running Apache2) to view a website on the server via your public IP

If either of these are incorrect let me know

  1. Ensure you first have port-fording setup on your main router to go to your Windows machine local IP. Open the correct port that your Appache2 server is running on.

  2. Ensure you have opened the correct port on your windows machine firewall to allow that inbound traffic

  3. Change the network settings for your VM to bridge the connection
Kareem
  • 569
  • 2
  • 18
  • Sorry I didn't mention that, but I'm using a desktop with Arch linux server, so it's not a virtual machine. I'm positive that the port I'm using is open in LAN, but the WAN port isn't, the port scanner tool says it open, but when scanning with nmap it says port is close (I'm using port 2112) – Aymane Boukrouh Sep 21 '19 at 21:11
  • If you can connect to the machine on the LAN then we can rule out the issue is to do with the firewall on your server. So the issue must lie with your router. Are you sure that you have opened the correct port and protocol and pointed it to your local servers ip? – Kareem Sep 21 '19 at 21:16
  • I added some pictures to my post, I don't have port forwarding option in my router page 192.168.1.1, so I used virtual server because I read it works the same way, thanks for your help! – Aymane Boukrouh Sep 21 '19 at 21:28
  • It worked, it seems that it has always been working, I never tried from outside the LAN before, and because the results were different from nmap and the port checker, I tried it, and it worked! Since it does, I don't care much now because I achieved what I wanted, but do you know why this happens ? – Aymane Boukrouh Sep 21 '19 at 21:56
  • Awesome! I am glad it works. It is possible that your router or firewall is designed to not respond to requests from programs like nmap, which is why is showed as closed. – Kareem Sep 21 '19 at 22:34