I am new to StackOverflow, please let me know if I need to edit this post to make it clearer.
Objective: Access through HTTP/HTTPS web app instances inside private subnet via wireguard vpn located inside public subnet (These subnets are all inside the same VPC).
Situation:
I have a VPC with:
- 1 public subnet containing an ec2 instance running wireguard VPN
- 4 private subnets individually containing ec2 running individual web apps (based on bitnami images) The wireguard instance has its own security group and the other instances share the same security group as the VPC. There is a NAT gateway inside the public subnet and all outbound connections from private subnets are routed to that NAT. I've setup a private hosted zone and added records to point domain names to instances inside the private subnets. (i.e. sub.test.com points to 10.0.1.1, etc.). I've enabled port forward and unchecked 'source/destination' on the wireguard ec2 instance.
Result: I can connect to the wireguard instance through SSH and wireguard client, but cannot access web apps ec2 inside private subnets.
Question: How can I access the instances inside the private subnets through the wireguard instance inside the public subnet ? (Is it a wireguard config issue or a route table issue ?)