Skip to content

Query Regarding Appropriate CIDR for Forwarding Incoming Traffic to Instance

0

I attempted to add an incoming traffic route policy to the subnet route table, but I encountered an error.

bastion

error

Could you kindly advise me on the appropriate CIDR that should be used for forwarding incoming traffic to an instance?

  • Public Subnet CIDR?
  • Public IPv4 address of the instance bastionhost?
  • Private IPv4 addresses of the instance(bastionhost)?
asked 2 years ago304 views
5 Answers
1
Accepted Answer

Hi,

If you are talking about ingress routing (routing via appliance) for internet traffic, kindly refer to the link [1] which explains how routing can be configured for public and private subnets. If you are just using bastion host for internet, you don't need to route traffic.

References: [1] https://aws.amazon.com/blogs/aws/new-vpc-ingress-routing-simplifying-integration-of-third-party-appliances/

AWS
answered 2 years ago
AWS
EXPERT
reviewed 2 years ago
AWS
EXPERT
reviewed 2 years ago
  • Thank you for your comment, Vamsi. Indeed, that was my initial thought as well. However, I currently do not have access to the internet.

  • Hi, Since you stated you don't have access to the internet, is it the EC2 instance that's not having the internet ? or you are unable to connect to EC2 instance which is in private subnet and you are trying to access from your local PC

    • If it's EC2 instance that is not having internet, Please check the route table and see if it has a route pointing to 0.0.0.0/0 via IGW-xxxx (or) 0.0.0.0/0 via NAT-gateway.
    • If you are unable to access EC2 instance in private subnet, you would need a bastion host in public subnet (that has a route to internet). Once your are connected to bastion host from your local PC, you will be able to connect to EC2 instance in private subnet from bastion host provided NACL's and SG's are correctly configured.
    • Another solution is EIC Endpoint provides a secure solution to connect to your instances via SSH or RDP in private subnets without IGWs, public IPs, agents, and bastion hosts. with this solution, you don't need internet to connect to EC2 instances in private subnet.
0

@Anupam Gupta Thanks for replying. I posted resource map, route table below. I set up the webhost(private subnet), bastionhost(public) for testing. Did you need NACLs and security group for both instances?

Enter image description here

Enter image description here

Enter image description here

answered 2 years ago
  • Now with this arrangement, Are you able to ssh into your bastian host from your local machine? If not, could you please provide screen shots for Security Group and NACLs settings. And the error that you are getting while making the connection.

  • Hey, Anupam Gupta Yes, I was able to access SSH after allowing ssh policy into the SG. I had to delete entire contents for now, but I will retest them once we decide to use AWS VPN. Thanks for following up.

  • Alright and all the best!

0

Hi,

I think, you do not need the route for bastian host specifically. You already have a route to Internet Gateway.

If you want to control the traffic then you can use Network ACLs and Security group in combination.

answered 2 years ago
  • Thanks for your comment @Anupam I concur with your viewpoint. However, I am encountering an issue when attempting to access the internet. I believe I might have overlooked a certain aspect, but I'm uncertain about the exact location of the oversight.

0

One good place to check --> If you select your VPC you can see "VPC resource map". If you need more assistence you can provide screen shorts for VPC resource map, route table, NACLs and security group.

answered 2 years ago
0

Hey, Vasmi Here I shared the diagram for your information. entireDiagram

As an alternative plan, I have established an additional test VPC without a private subnet. However, this VPC also lacks internet connectivity. I believe I might be overlooking a significant aspect in this scenario.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.