I have assigned an egress only internet gateway to my private subnet. Now I can connect with IPV6 websites but not with IPV4 addresses.
Do I need NAT gateways to access IPV4 address from my EC2 machine? (Only outgoing traffic)
You need either a NAT Gateway, or simply an Internet Gateway. But if you are only interested in outgoing, then a NAT Gateway is the way to go.
Egress only internet gateways are for IPv6 only. As mentioned in the documentation for them.
Yes, you need a NAT Gateway to access IPv4 websites from your EC2 instance in private subnet.
To make the instance in private subnet to access both IPv4 and IPv6 websites, we need:
IPv4 outgoing traffic)IPv6 outgoing traffic)Don't forget to assign an IPv6 address to the instance in private subnet otherwise the instance cannot access IPv6 websites.
*A public IPv4 address is not needed for the instance in private subnet. We can access IPv4 websites without it.
Moreover, with the commands below, we can check if the connections to IPv4 and IPv6 websites are available from the instance in private subnet.
For IPv4 websites:
ping -4 google.com
For IPv6 websites:
ping -6 google.com
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With