3

I'm trying to connect a route table and an internet gateway in the AWS VPC dashboard.

It's serving me this error:

route table and network gateway belong to different networks

Specifically, I'm trying to associate the internet gateway to the route table with destination 0.0.0.0/0 and target as the internet gateway id.

To speak more broadly about the setup I'm trying to achieve, I'd like to have a VPC with two subnets, one for us-east-2a and the other for us-east-2b. I'd like to connect those subnets to a route table that is connected to an internet gateway and then put the VPC in a security group.

I'd like my AWS EC2 instance to be available to only a specific list of IP addresses.

3 Answers 3

3

You need to create a new internet gateway in the same VPC as the route table. On the VPC section in the AWS console, find the vpc id of your route table. And then go to the internet gateway section of the vpc console. Find an internet gateway in the same vpc as your route table. If there is none, create one. And then go back and try to add your route. Select the new internet gateway as the target for 0.0.0.0/0 CIDR

Sign up to request clarification or add additional context in comments.

Comments

1

on AWS console navigate to VPC > Internet gateways. then select the internet gateway which is not in the same network > attach to VPC > choose your VPC > save

Comments

0

The Error: route table and network gateway belong to different networks, indicating route tbl is not associated /attached to a VPC.

As shown, in pic 1.current set up the Internet gateway is detached.

Solution: Navigate to AWS console, VPC > Internet gateways. then select the internet gateway which is not in the same network > attach to VPC

As shown in pic 2 & 3.sep one & sep two

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.