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

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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ