Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to access local server running after VPN connection

I have local application server running and I can access it using http://localhost:4554.

If I connect to VPN not able to load above url. I am using dongle to connect to internet.

Please help!

like image 235
rohitkadam19 Avatar asked Aug 19 '15 19:08

rohitkadam19


People also ask

How do I access server after VPN connection?

On the client PC, right-click Start and go to Network Connections. Click on VPN and then Add a VPN connection. Set VPN provider to Windows (built-in) and write a Connection name. At Server name or address, type the public IP address of the host PC.

Can you access local network while on VPN?

In order to simultaneously access the local and remote VPN network you need to enable a feature called split-tunneling. Due the security reasons outlined above, I do not recommend enabling this, however in some cases it is necessary or perhaps you just wanted to know why.

Why after connecting VPN internet is not working?

If your VPN software is not working properly, you can do several things: check your network settings, change your server, make sure the right ports are opened, disable the firewall, and reinstall your VPN software. If none of the below methods are working, it's time to contact your VPN provider.


3 Answers

Using 127.0.0.1 instead of localhost as my host in the mysql connection settings solved the issue for me. I am on Avaya VPN

like image 195
Rupesh Jain Avatar answered Oct 17 '22 13:10

Rupesh Jain


To connect to localhost you must be connected to the same network as the device that is hosting the files. When you connect to a VPN however this is not the case. When you connect to a VPN it is similar to being on a completely different network as your external ip address will change therefore the local files cannot be reached. To access localhost in this case what you have to do is

  1. Ensure that VPN is off
  2. Set up port forwarding and then find out your external ip address.
  3. Test it by using the external ip address instead of localhost. At this point you should be connected to the your local server.
  4. Enable VPN and enter your previous external ip address because remember that your external ip address will change once VPN is enabled
like image 26
otboss Avatar answered Oct 17 '22 13:10

otboss


One problem might cause this kind of behavior. If you are connected to a corporate network by VPN, the VPN connection will change the search domain, for example, mycompany.corp.

On the other hand, some systems in the corporate network might register themselves as 'localhost.mycompany.corp' ( this should be a mistake ).

The result is localhost.mycompany.corp will now be resolved to a private IP like 10.xx.xx.xx, and when you tried to access http://localhost:4554/ , the request is sent to 10.xx.xx.xx port 4554, instead of the supposed 127.0.0.1 port 4544.

like image 1
jack.chen.job Avatar answered Oct 17 '22 12:10

jack.chen.job