The firewall of a simple application server is a virtual firewall that uses firewall rules to control the inbound traffic of the simple application server. This ensures the security of the server. This topic describes how to create, modify, disable, enable, and delete firewall rules for a simple application server. This topic also provides information about the ports preset for the firewall feature, FAQ about firewalls, and related documents.
Description
By default, the firewall of a simple application server enables specific ports based on the operating system of the server and disables other ports. You can create firewall rules to enable more ports based on your business requirements. The following list describes the default ports that are enabled on a simple application server:
Servers that use the TCP protocol:
Windows servers: ports 3389, 80, and 443.
Linux servers: ports 22, 80, and 443.
Servers that use the ICMP protocol: The value for the port range is -1, which specifies that all ports are enabled and access from all IP addresses is allowed.
If you remove or disable these default ports in the Simple Application Server console, the Firewall tab of the Servers page displays a message similar to You disabled or deleted the default port 22 allow rule on the firewall, which affects the remote connection feature
. You can add or enable the corresponding ports based on your requirements.
Limits
You can create a maximum of 50 firewall rules for a simple application server.
Port 25 is the default email service port. For security reasons, this port is disabled for simple application servers by default. To send emails, use port 465.
A firewall controls only the inbound traffic of a simple application server. All outbound traffic of a simple application server is allowed by default.
NoteInbound traffic: the traffic generated when data is transmitted to a simple application server over the Internet or an internal network.
Outbound traffic: the traffic generated when data is transmitted from a simple application server over the Internet or an internal network.
Manage a firewall
If you have created a firewall template, you can quickly configure firewall rules based on the firewall template. For more information, see the "Configure firewall rules based on a firewall template" section of the Manage firewall templates topic.
Log on to the Simple Application Server console.
In the left-side navigation pane, click Servers.
Find the simple application server for which you want to create a firewall rule, and click the server ID in the card of the server.
Click the Firewall tab.
In the upper-left corner of the Firewall tab, click Add Rule.
In the Add Firewall Rule dialog box, configure parameters based on your business requirements and click OK.
WarningWhen you create a firewall rule, configure the port range and IP addresses that are allowed to access the server based on your requirements and follow the principle of least privilege to prevent network attacks.
If the ports, protocol, and IP addresses that you specify for the firewall rule are the same as the ports, protocol, and IP addresses of an existing rule, the existing rule is overwritten regardless of whether the existing rule is enabled or disabled.
Select a preset firewall rule
You can create a firewall rule with ease by selecting a preset firewall rule. The following table describes the parameters.
Parameter
Description
Application Type
The application type. Select an application type such as RDP, FTP, TELNET, MYSQL, All Use TCP, All Use UDP, or All Use TCP and UDP from the drop-down list based on your business requirements. For more information, see the "Preset port information" section of this topic.
Protocol
The protocol. The displayed protocol is used by default and the value cannot be changed.
Port Range
The port range. The displayed port range is used by default and the value cannot be changed.
Source IP Address
The source IP addresses. The default value is 0.0.0.0/0, which specifies all IPv4 addresses.
ImportantConfigure IP addresses based on your requirements and follow the principle of least privilege to prevent network attacks on your server.
Remarks
Enter the remarks of the firewall rule for subsequent management.
Create a custom firewall rule
If the preset firewall rules cannot meet your business requirements, you can create one or more custom firewall rules. The following table describes the parameters.
Parameter
Description
Application Type
The application type. Select Specify a custom value.
Protocol
The protocol. Select TCP, UDP, or ICMP.
Port Range
The port range. Valid values: 1 to 65535. You can use one of the following methods to configure this parameter:
Specify a single port.
Enter the number of the port that you want to enable. For example, if you want to allow traffic on MySQL listening port 3306, enter
3306
in the Port Range field.Specify a port range.
Use a forward slash (/) to separate the start port number and the end port number. For example, if you want to allow traffic over the port range 20000 to 30000 that you specify in the FTP configuration file, enter
20000/30000
in the Port Range field.
Source IP Address
The source IP addresses. The default value is 0.0.0.0/0, which specifies all IPv4 addresses. You can also specify the IPv4 addresses that are allowed to access the server:
Specify a single IPv4 address.
Enter a single IPv4 address. Example: 192.168.0.100.
Specify the IPv4 addresses within a CIDR block.
Enter an IPv4 CIDR block. Example: 192.168.0.0/24.
Remarks
Enter the remarks of the firewall rule for subsequent management.
You can click Add Rule to create firewall rules and the icon to delete firewall rules as needed.
Modify, disable, enable, and delete a firewall rule
After you create a firewall rule, you can perform the following operations based on your business requirements.
Operation | Description | Procedure |
Modify a firewall rule | If the firewall rules that are created or automatically created do not meet your business requirements, you can modify the firewall rules. |
|
Disable a firewall rule | You can temporarily disable a port. If you want to allow traffic on the port later, you can enable it directly without the need to create a firewall rule again. Important If a firewall rule is disabled, the port specified in the rule cannot be accessed. This affects your business. We recommend that you disable a firewall rule with caution. Make sure that this operation does not affect your business. |
|
Enable a firewall rule | You can enable a disabled port. |
|
Delete a firewall rule | You can delete a firewall rule that you no longer use. Note If the number of firewall rules does not reach the upper limit of 50, we recommend that you temporarily disable a firewall rule for later use. | Delete a single firewall rule
Delete multiple firewall rules at a time
|
Preset port information
The following table describes the common firewall rules preset in firewalls provided by Alibaba Cloud. You can create firewall rules with ease by using these preset firewall rules. For more information about common ports, see Common ports.
Application type | Protocol | Port range | Source IP address | Description |
HTTP | TCP | 80 | 0.0.0.0/0 Important
| The default HTTP port. The port is used to access website services such as Internet Information Services (IIS), Apache, and NGINX. For more information, see Deploy Apache based on a CentOS OS image. |
HTTPS | TCP | 443 | The default HTTPS port. For more information, see the following topics: | |
RDP | TCP | 3389 | The default Remote Desktop Protocol (RDP) port. The port is used to connect to a Windows server by using Remote Desktop. For more information, see Connect to a Windows server. | |
FTP | TCP | 21 | The default FTP port. The port is used to upload and download files. For more information, see Build an FTP server (Linux). | |
TELNET | TCP | 23 | The default Telnet port. | |
MySQL | TCP | 3306 | The default MySQL port. For more information, see Use DMS to connect to a database on a simple application server. | |
SQLServer | TCP | 1433 | The default SQL Server port. | |
All Use TCP | TCP | 1 to 65535 | All TCP ports. | |
All Use UDP | UDP | 1 to 65535 | All UDP ports. | |
All Use TCP and UDP | TCP+UDP | 1 to 65535 | All TCP and UDP ports. | |
Specify a custom value | TCP, UDP, or ICMP | 1 to 65535 | The custom port range. |
FAQ
References
If you cannot access the website or the simple application server after you configure firewall rules, or the firewall of the server does not meet your business requirements, see the following topics: