The route for the VPC not showing in iproute2 when a subnet has different mask

0

I have a VPC with 10.0.0.0/24 network and a subnet with 10.0.0.0/27 address.

The route table in AWS console shows the default gateway route and 10.0.0.0/24 with target local. The same routes show in cloud-init log, but ip route show only shows the default gateway and a local route to 10.0.0.0/27.

I tested with Amazon Linux and Debian with the same result.

How do I get a route to 10.0.0.0/24 in the OS? Is this expected behaviour?

Cheers

Raphael
已提问 2 年前377 查看次数
1 回答
2
已接受的回答

It is expected behavior. The VPC router (.1 address) will take care of routing across subnets. The OS of the instance will only see a default route to the .1 address. You should be able to communicate within the VPC (please ensure that Security Groups, NACLs allow appropriate access).

Here's a good landing page for VPC routing: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html

AWS
AC
已回答 2 年前
profile pictureAWS
专家
已审核 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则