大网数据广告活动
服务器运维问答

Connecting OpenVPN client over Peering Connection to different VPC AWS

· 52CE 我爱测

I am trying to connect the VPN client to VPC different than VPN server belongs to. That's my setup: Network diagram However I can't manage the VPN client 10.8.0.6 to be able to reach the instance in the non-VPN VPC 10.24.0.249. D…

问题原文

原帖链接 · Tom Raganowicz · CC BY-SA 3.0

I am trying to connect the VPN client to VPC different than VPN server belongs to. That's my setup: Network diagram

However I can't manage the VPN client 10.8.0.6 to be able to reach the instance in the non-VPN VPC 10.24.0.249.

Description of my diagram:

There are 2 VPCs. The VPN Server is just in one of the VPCs. Between VPCs there is a Peering Connection (PXC). There are routes added to the VPCs route tables, so they know they should push traffic over PXC. On the non-VPN VPC, using the Security Groups, the instance allowed incoming traffic from the VPN VPC subnet and the VPN Client subnet.

The OpenVPN server pushes the routes to the client:

 push "route 10.26.0.0 255.255.255.0"
 push "route 10.24.0.0 255.255.255.0"

VPN Client 10.8.0.6 can contact any node in the VPN VPC including the VPN server 10.26.0.81.
VPN server 10.26.0.81 can contact any node in the non-VPN VPC e.g 10.24.0.249.

When you look at it separately it works, but the VPN client for some reason can't reach the remote instance in the non-VPN VPC.

Any ideas what shall I check?

已采纳解答

原帖链接 · Michael - sqlbot · CC BY-SA 3.0

This is a designed-in limitation:

If either VPC in a peering relationship has one of the following connections, you cannot extend the peering relationship to that connection:

  • A VPN connection or an AWS Direct Connect connection to a corporate network

http://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/invalid-peering-configurations.html

Consider these questions:

  • In the VPC with the VPN connection, which routing table is responsible for the routing decisions for traffic received from the peering connection, so that the traffic from the peered VPC can return over the VPN connection?

  • In the VPC with the VPN connection, which routing table is responsible for the routing decisions for traffic received over the VPN, so that traffic from the VPN can be sent to the peered VPC?

Actually, those are trick questions.

No routing table applies to the traffic received from a VPN connection or received over a peering connection. Traffic from those sources can only reach instances in your VPC's supernet CIDR block. The routing of inbound traffic is implicit and not configurable. The route tables in VPCs only apply to traffic originated by the instances on the subnets in the VPC. The default route table is merely the route table that applies to any subnet without its own route table assignment -- that is the only sense in which it is a "default" route table.

Only things with elastic network interfaces -- instances, essentially -- in the other VPC are accessible across a peering connection. Nothing external or external-facing can be accessed across a connection, including VPN, Direct Connect, NAT Gateway, Internet Gateway, or VPC Endpoint (available, as of this writing, only for S3).

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-06-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。