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 | Ports |
---|---|---|---|
1. | Ping (ICMP - IPv4) | 0.0.0.0/0 (anywhere) | |
2. | SSH | 0.0.0.0/0 (anywhere) | |
3. | UDP (IPsec) | 0.0.0.0/0 (anywhere) | 500 |
4. | UDP (IPsec) | 0.0.0.0/0 (anywhere) | 4500 |
Data-SG-Public
.Allow IPSec, SSH, ping from internet
.Config Inbound rules
Allow ping connection, choose Add rule:
Allow SSH connection, choose Add rule:
Allow UDP (IPSec) connection, choose Add rule:
500
to allow ping from IPv4.Do the same with UDP port 500
, we create UDP port 4500
.
And we keep Outbound rules as the default.
Scroll down at the bottom of page and click at Create security group, so we have finished creating the necessary security groups for the EC2 instances.
You can find more information about How does IPsec work? and IPsec protocol port in VPN connection.