- Newest
- Most votes
- Most comments
You can do this by adding a route to your route table associated with the subnet. Something like this:
aws ec2 create-route --route-table-id rtb-22574640 \
--destination-cidr-block 192.168.2.0/24 \
--network-interface-id eni-c0a643a9
Note that if you have source packets coming from a network not in your VPC, you will need to turn src/dest validation off for that instance which is forwarding the packets.
Got it, thanks for clarifying. The CIDR of the route needs to be the entire CIDR of a subnet within the VPC. You'll need to ensure that the middlebox appliance (said EC2 instance) needs to be in a dedicated subnet of its own.
This blog provides a detailed walkthrough of how to insert a middlebox appliance between two subnets.
By default, you'll have a 'local' route within the VPC that allows connectivity within the VPC. Can you confirm that you have the local route in your subnet route tables? Did you create any Security Groups or Network Access Control Lists to block communication?
Our instances see each other, but we want to send specific traffic from one instance to the other. For example: the packets that will have the IP 192.168.2.0/24 as their destination will be forwarded to the other instance.
Relevant content
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
Is the /16 you are trying to route not the VPC's CIDR address(es)?