- AWS Networking Cookbook
- Satyajit Das Jhalak Modi
- 179字
- 2021-07-02 19:41:31
Getting ready
We need an AWS account and user with proper permissions for creating a NAT instance on EC2. Create an EC2 in the same way as the previous recipe. The only difference is, you don't put any Advanced Details in the Choose Network page. In the security group page, create NATSG security group and attach the same with instance with the following rules. We are allowing all traffic for simplicity. However, you should only put the required CIDR ranges.
NATSG: Rules
Inbound
Type
Protocol
Port range
Source
HTTP
TCP
80
0.0.0.0/0 and ::/0
HTTPS
TCP
443
0.0.0.0/0 and ::/0
SSL
TCP
22
0.0.0.0/0 and ::/0
Outbound
Destination
Protocol
Port range
Comments
All traffic
TCP
ALL
0.0.0.0/0 and ::/0
You can use the same key pair created before for this instance as well. In the Add tag page, put Nat Instance in value for Name and Key. We also need to create an Elastic IP for attaching it to a NAT instance. This we shall show in the recipe.