Jump to content
Not connected, Your IP: 216.73.216.76
Sign in to follow this  
tduiwz

ANSWERED Can't connect to myself through forwarded port

Recommended Posts

Posted ... (edited)

On Windows PC running Eddie/WireGuard, I can connect to the forwarded port from any computer except the PC running the VPN software. This is rather inconvenient since I can't easily test the connections from the same computer, or have two services on the same computer communicate with each other over the VPN tunnel (e.g. two torrent clients, both with forwarded ports)

I tried a variety of tools to test, but for example, in one terminal on the PC
$ netcat -l -p [FORWARDED PORT]

then in another terminal:
$ netcat [VPN exit IP] [FORWARDED PORT]

the TCP connection fails.

but if I run the exact same command to connect to the server from any other computer, the connection is successful

Edited ... by tduiwz

Share this post


Link to post
8 hours ago, tduiwz said:

On Windows PC running Eddie/WireGuard, I can connect to the forwarded port from any computer except the PC running the VPN software.


Hello!

This is expected. It is also unavoidable: consider that inside the VPN server packets originated by your node when it is a source pass through public entry-IP address -> virtual network -> exit-IP address -> final destination. When your node is a destination from external source, packets reaching the exit-IP address are forwarded to the virtual network, encrypted and sent to your VPN IP address

So, if your VPN IP address is both source and destination and the packet should simultaneously get out of and enter the exit-IP address etc., what happens? You create a network loop because there's no self-routing logic for your packet between entry -> VPN -> exit -> exit again -> VPN and finally entry addresses, and the packet is lost. The VPN is not designed as a loopback device, so to speak. Use your system loopback interface to have the system communicate with itself as a simultaneous source and destination.
 
8 hours ago, tduiwz said:

have two services on the same computer communicate with each other over the VPN tunnel


This is a different issue and this behavior is explicitly blocked in the infrastructure for security reasons. It is a valuable VPN feature (allowing sharing resources, sharing the same network) in virtual networks where all the nodes are known and trusted, but it is dangerous in a public VPN service or in general where nodes can not be trusted by each other. The only shared resource in the VPN is the DNS server. No node can reach another node inside the VPN itself.

Kind regards
 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image
Sign in to follow this  

×
×
  • Create New...