Server → Client Communications in a VPN

Asked 1 years ago, Updated 1 years ago, 167 views

I couldn't find any clear information about the communication on the subject, so could you please let me know if you know?

Specific Environment

  • VPNs:VPNs in AWS (OpenVPN)
  • From: EC2 Instance (Linux)
  • Connect to: VPN Client (PC under Home Router)
  • Communication Protocol:HTTP

I would like to send an HTTP request from the EC2 instance to my home web server.

Naturally, communication from the VPN client to the EC2 instance is fine over the VPN.
Is reverse communication generally difficult?

aws amazon-ec2 vpc


2022-09-29 22:20

2 Answers

Because the answers below were to the questions before the comments and questions were edited, the assumption is that you have a web server in your home apart from the PC running the VPN client.Therefore, the answer to the edited question will not be correct.However, if the PC and the web server are different, it will be helpful, so I will leave the answer as it is.

It is very difficult to communicate with a typical VPN client running on a PC (such as the vpnux client for OpenVPN).It's not impossible to route a PC, set the appropriate routing table, or connect with a bridge, but you need to know some networking.

Typically, a VPN client connection is the virtual connection of the PC on which the VPN client is running to the network on the VPN server side.It feels like only the PC is connected to the network over there, and the terminals around the PC are left behind.On the other hand, from the perspective of the network over there, it feels like only one new PC has appeared on the network.Therefore, it is possible to communicate to the PC, but you cannot see the web server around the PC.

As a network, in addition to physical NICs, PCs have virtual NICs that are connected to different networks (in fact, they are recognized as two NICs on the OS).Do you understand that connecting a PC with two NICs to a separate network does not allow the networks to communicate with each other?However, in this situation, you can still communicate by enabling IP routing on your PC and configuring the appropriate routing table for each network, or by configuring the two NICs for bridge connections.Here's what I said first.If you have two NICs on your PC and you don't know how to configure them, it will be difficult to do the same with a VPN client.

In addition, there is a two-way VPN connection between networks called inter-site VPNs, but in reality, only VPN-enabled network equipment and Linux servers are properly routed or bridged.


2022-09-29 22:20

Do you mean that the EC2 instance can communicate until tun0?

If you are communicating from an EC2 instance to an IP address assigned to Raspberry Pi's tun 0, you might want to configure routing.
However, the IP address of the クライアントclient VPN network interface の to which it is routed is variable and may not be permitted by the AWS Client VPN service side in the first place.

Another possible way is to create a reverse tunnel from Raspberry Pi to EC2 instance with SSH RemoteForward (-R option).


2022-09-29 22:20

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.