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 Antwort
2
Akzeptierte Antwort

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
beantwortet vor 2 Jahren
profile pictureAWS
EXPERTE
überprüft vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen