Reputation: 602
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)
Upvotes: 4
Views: 2894
Reputation: 1
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
Upvotes: 1
Reputation: 3322
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.
Upvotes: 5