简体   繁体   中英

AWS NAT Gateway Public IP Address for Whitelisting with Public Subnet

I have an EC2 instance in a public subnet and I assigned an EIP to the instance and the IP address is Whitelisted to reach my company's network. The Instance must have a public IP address but I don't want to use EIP here. Whenever I restart the server the IP address is changing so I thought If I create a NAT Gateway and arrange the routeing table to use connect my company's network but when I do that I cannot reach the instance. NAT Gateway for the private network for but is there a way to set a static IP address to reach some places?

Default settings for the route table

在此处输入图像描述

Setting use NAT Gateway by default access did not work

在此处输入图像描述

Adding a new route for the company network did not work

在此处输入图像描述

To have a static IP address within AWS, you must use an Elastic IP. Even if you use a NAT Gateway, it consumes an EIP.

From the docs :

You must also specify an Elastic IP address to associate with the NAT gateway when you create it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM