У меня 2 VPC на AWS VPC-A 172.31.0.016
и VPC-B 172.17.0.0/24
Я создал пиринг VPC и могу подключиться ко всем службам, работающим на VPC-B
из VPC-A
и наоборот.
Теперь я создал фланелевую виртуальную сеть в VPC-B
с адресом 172.17.0.0/16
etcdctl set /coreos.com/network/config '{ "Network": "10.17.0.0/16", "Backend": {"Type": "aws-vpc"} }'
В aws-vpc
бэкэнд работает, потому что маршруты появились в VPC-B
таблица маршрутизации и машины в VPC могут достигать сервисов, размещенных во фланелевой сети, но я не смог связаться с хостами в 172.17.0.0/16
из VPC-A
.
VPC-A
таблица маршрутизации:
$ aws ec2 describe-route-tables --route-table-id rtb-f6e7e59d
------------------------------------------------------------------------------------------------------
| DescribeRouteTables |
+----------------------------------------------------------------------------------------------------+
|| RouteTables ||
|+------------------------------------------------+-------------------------------------------------+|
|| RouteTableId | VpcId ||
|+------------------------------------------------+-------------------------------------------------+|
|| rtb-f6e7e59d | vpc-ffe7e594 ||
|+------------------------------------------------+-------------------------------------------------+|
||| Associations |||
||+-------------+---------------------------------------------------+------------------------------+||
||| Main | RouteTableAssociationId | RouteTableId |||
||+-------------+---------------------------------------------------+------------------------------+||
||| True | rtbassoc-f5e7e59e | rtb-f6e7e59d |||
||+-------------+---------------------------------------------------+------------------------------+||
||| Routes |||
||+-----------------------+---------------+-------------------+---------+--------------------------+||
||| DestinationCidrBlock | GatewayId | Origin | State | VpcPeeringConnectionId |||
||+-----------------------+---------------+-------------------+---------+--------------------------+||
||| 172.31.0.0/16 | local | CreateRouteTable | active | |||
||| 172.17.0.0/16 | | CreateRoute | active | pcx-ea7ea083 |||
||| 10.17.0.0/16 | | CreateRoute | active | pcx-ea7ea083 |||
||| 0.0.0.0/0 | igw-f3e7e598 | CreateRoute | active | |||
||+-----------------------+---------------+-------------------+---------+--------------------------+||
VPC-B
таблица маршрутизации:
$ aws ec2 describe-route-tables --route-table-id rtb-c0729da4
-------------------------------------------------------------------------------------------------------------------------------------------------------------
| DescribeRouteTables |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
|| RouteTables ||
|+---------------------------------------------------------------------------+-----------------------------------------------------------------------------+|
|| RouteTableId | VpcId ||
|+---------------------------------------------------------------------------+-----------------------------------------------------------------------------+|
|| rtb-c0729da4 | vpc-79a3991c ||
|+---------------------------------------------------------------------------+-----------------------------------------------------------------------------+|
||| Associations |||
||+-----------------+---------------------------------------------------------+---------------------------------+-----------------------------------------+||
||| Main | RouteTableAssociationId | RouteTableId | SubnetId |||
||+-----------------+---------------------------------------------------------+---------------------------------+-----------------------------------------+||
||| False | rtbassoc-8a48e7ee | rtb-c0729da4 | subnet-e655b982 |||
||| False | rtbassoc-8b48e7ef | rtb-c0729da4 | subnet-ddfde9aa |||
||| False | rtbassoc-8948e7ed | rtb-c0729da4 | subnet-5f725e06 |||
||+-----------------+---------------------------------------------------------+---------------------------------+-----------------------------------------+||
||| Routes |||
||+----------------------+---------------+-------------+------------------+---------------------+-------------------+----------+--------------------------+||
||| DestinationCidrBlock | GatewayId | InstanceId | InstanceOwnerId | NetworkInterfaceId | Origin | State | VpcPeeringConnectionId |||
||+----------------------+---------------+-------------+------------------+---------------------+-------------------+----------+--------------------------+||
||| 172.17.0.0/24 | local | | | | CreateRouteTable | active | |||
||| 10.17.75.0/24 | | i-5a19fdd6 | 616776393312 | eni-ad3930f7 | CreateRoute | active | |||
||| 172.31.0.0/16 | | | | | CreateRoute | active | pcx-ea7ea083 |||
||| 0.0.0.0/0 | igw-b3eb9ad6 | | | | CreateRoute | active | |||
||+----------------------+---------------+-------------+------------------+---------------------+-------------------+----------+--------------------------+||