In this step, we will create the security groups used for our instances. These security groups specify to the VPC which connections are allowed or permitted. A security group acts as a virtual firewall that controls traffic for one or more instances. By default, AWS allows all outbound traffic but restricts inbound traffic. We only config the directions inbound in this lab.
Inbound rules:
ID | Connection Types | Sources |
---|---|---|
1. | Ping (ICMP - IPv4) | 0.0.0.0/0 (anywhere) |
In the Security group name section, enter Cloud-SG-Public
.
Allow ping for public subnet
.Config Inbound rules
Choose Add rule:
And we keep Outbound rules as the default.
Scroll down at the bottom of page and click at Create security group. The result will show as below:
After successfully creating a security group for the public subnet, we continue to create security group for instance located in private subnet.
Inbound rules:
ID | Connection Types | Sources |
---|---|---|
1. | SSH | 192.168.1.0/24 (LAN of Data Server) |
2. | Ping (ICMP - IPv4) | 0.0.0.0/0 (everywhere) |
Go to VPC dashboard, choose Security groups and click Create security group again.
In the Security group name section, enter Cloud-SG-Private
.
Allow ping, SSH for server in private subnet
.Config Inbound rules
Choose Add rule:
192.168.1.0/24
Continue choose Add rule:
And we keep Outbound rules as the default.
Scroll down at the bottom of page and click at Create security group. The result will be shown as below:
So we have finished creating the necessary security groups for the EC2 instances.