Security Group Configuration Examples
This section describes common security group configuration examples. These examples allow all outgoing data packets by default and only describe how to configure the inbound rules of a security group.
- Enabling HECSs in Different Security Groups to Communicate with Each Other Through an Internal Network
- Enabling Specified IP Addresses to Remotely Access HECSs in a Security Group
- Remotely Access a Linux HECS Using SSH
- Remotely Access a Windows HECS Using RDP
- Pinging an HECS from the Internet
- Enabling an HECS to Function as a Web Server
- Enabling an HECS to Function as a DNS Server
- Uploading or Downloading Files Using FTP
Enabling HECSs in Different Security Groups to Communicate with Each Other Through an Internal Network
- Example scenario
Resources on an HECS in a security group need to be copied to an HECS associated with another security group, and the two HECSs are in the same VPC. We recommend that you enable internal network communication between the HECSs and then copy the resources.
- Security group configuration
Within a given VPC, HECSs in the same security group can communicate with one another by default. However, HECSs in different security groups cannot communicate with each other by default. To enable these ECSs to communicate with each other, you need to add certain security group rules.
You can add an inbound rule to the security groups containing the HECSs to allow access from HECSs in the other security group. The required rule is as follows.
Table 1 Used for communication through an internal network Direction
Protocol/Application
Port
Source
Inbound
Protocol used for intranet interworking
Port or port range
ID of the other security group
Enabling Specified IP Addresses to Remotely Access HECSs in a Security Group
- Example scenario
To prevent HECSs from being attacked, you can change the port number for remote login and configure security group rules that allow only specified IP addresses to remotely access the HECSs.
- Security group configuration
To allow IP address 192.168.20.2 to remotely access Linux HECSs in a security group over SSH and port 22, you can configure the following security group rule.
Table 2 Port 22 Direction
Protocol/Application
Port
Source
Inbound
SSH
22
IPv4 CIDR block or ID of another security group
For example, 192.168.20.2/32
Remotely Access a Linux HECS Using SSH
- Example scenario
After creating a Linux HECS, you can add a security group rule to enable remote SSH access to the HECS.
The default security group comes with this rule. You do not need to configure the rule again if you use the group.
- Security group configuration
Direction
Protocol/Application
Port
Source
Inbound
SSH
22
0.0.0.0/0
Remotely Access a Windows HECS Using RDP
- Example scenario
After creating a Windows HECS, you can add a security group rule to enable remote RDP access to the HECS.
The default security group comes with the following rule. If you use the default security group, you do not need to add this rule again.
- Security group configuration
Direction
Protocol/Application
Port
Source
Inbound
RDP
3389
0.0.0.0/0
Enabling an HECS to Function as a Web Server
- Example scenario
If you deploy a website on your HECS and require that your website be accessed over HTTP or HTTPS, you can add rules to the security group used by the HECS that functions as a web server.
- Security group configuration
Direction
Protocol/Application
Port
Source
Inbound
HTTP
80
0.0.0.0/0
Inbound
HTTPS
443
0.0.0.0/0
Enabling an HECS to Function as a DNS Server
- Example scenario
If you need to use an HECS as a DNS server, you must enable TCP and UDP access from port 53 to the DNS server. You can add the following rules to the security group associated with the HECS.
- Security group configuration
Direction
Protocol/Application
Port
Source
Inbound
TCP
53
0.0.0.0/0
Inbound
UDP
53
0.0.0.0/0
Uploading or Downloading Files Using FTP
- Example scenario
If you want to use FTP to upload files to or download files from HECSs, you must add a security group rule.
You must first install the FTP server program on the HECSs and check whether ports 20 and 21 are working properly. For instructions on how to install the FTP server program, see Setting Up an FTP Site (Windows) or Setting Up an FTP Site (Linux).
- Security group configuration
Direction
Protocol/Application
Port
Source
Inbound
TCP
20-21
0.0.0.0/0
Last Article: Default Security Group and Rules
Next Article: Configuring Security Group Rules
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.