I used anyip feature of Linux in on premise server and it worked well but when i followed the same procedures in an AWS Ubuntu instance i am unable to ping from a different machine in the same subnet, please let me know if there’s any extra configuration i need to do from AWS perspective
- I have allowed ipv4 ICMP over 0.0.0.0/0
Following are the steps i followed
-
ip -4 route add local 192.168.0.0/24 dev lo (executed on source)
-
route add -net 192.168.0.0/24 gw source machine ip (executed in destination)
2
Answers
After following all the procedure which i mentioned in my question i just need to turn off "source/destination check" in EC2 actions
As you want to send all traffic to a certain VM and use it as gateway you need to create a custom route table and add the rules.
You also need to set up the security group rules correctly.
Please check the sample steps for Internet GW. These steps will be useful for you. You need to route the traffic to the EC2 instance instead of Internet GW.
https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html#Add_IGW_Routing