If you know the ports commonly used by Elastic Compute Service (ECS) instances, you can add network access control list (ACL) rules in a more accurate manner. This topic describes the ports commonly used by ECS instances and the scenarios of these ports.

Ports

The following table lists the ports and the services that use these ports.

PortServiceDescription
21FTPThe FTP port. It is used to upload and download files.
22SSHThe SSH port. It is used to log on to Linux instances with the command line method by using username and password pairs.
23TelnetThe Telnet port. It is used to log on to ECS instances.
25SMTPThe SMTP port. It is used to send emails.
80HTTPThe HTTP port. It is used to access services such as IIS, Apache, and NGINX.
110POP3The POP3 port. It is used to receive emails.
143IMAPThe Internet Message Access Protocol (IMAP) port. It is used to receive emails.
443HTTPSThe HTTPS port. It is used to access services. The HTTPS protocol can implement encrypted and secure data transmission.
1433SQL ServerThe TCP port of SQL Server. It is used for SQL Server to provide external services.
1434SQL ServerThe UDP port of SQL Server. It is used to return the TCP/IP port occupied by SQL Server.
1521OracleThe Oracle communication port. ECS instances that run Oracle SQL must have this port enabled.
3306MySQLThe MySQL port. It is used for MySQL databases to provide external services.
3389Windows Server Remote Desktop ServicesThe Windows Server Remote Desktop Services port. It is used to log on to Windows instances.
8080Proxy portAn alternative to port 80. It is commonly used for WWW proxy services.

Custom network ACL rules

Inbound rules and Outbound rules describe a network ACL example for VPCs that support only IPv4 addresses.
  • The inbound rules in effective order 1, 2, 3, and 4 respectively allow HTTP, HTTPS, SSH, and RDP traffic to the vSwitch. Outbound response rules are those in effective order 3.
  • The outbound rules in effective order 1 and 2 respectively allow HTTP and HTTPS traffic from the vSwitch. Outbound response rules are those in effective order 5.
  • The inbound rule in effective order 6 denies all inbound IPv4 traffic. This rule ensures that packets that do not match other rules are denied.
  • The outbound rule in effective order 4 denies all outbound IPv4 traffic. This rule ensures that packets that do not match other rules are denied.
Note An inbound or outbound rule must correspond to an inbound or outbound rule that allows response traffic.
Table 1. Inbound rules
Effective orderProtocolSource IP addressDestination port rangeActionDescription
1tcp0.0.0.0/080/80AllowAllows HTTP traffic from IPv4 addresses.
2tcp0.0.0.0/0443/443AllowAllows HTTPS traffic from IPv4 addresses.
3tcp0.0.0.0/022/22AllowAllows SSH traffic from IPv4 addresses.
4tcp0.0.0.0/03389/3389AllowAllows RDP traffic from IPv4 addresses.
5tcp0.0.0.0/032768/65535AllowAllows TCP traffic from IPv4 addresses to ports 32768 to 65535.

This port range is for reference only. For more information on how to select appropriate ephemeral ports, see Ephemeral ports.

6all0.0.0.0/0-1/-1DenyDenies all inbound IPv4 traffic.
Table 2. Outbound rules
Effective orderProtocolDestination IP addressDestination port rangeActionDescription
1tcp0.0.0.0/080/80AllowAllows outbound IPv4 HTTP traffic from the vSwitch to the Internet.
2tcp0.0.0.0/0443/443AllowAllows outbound IPv4 HTTPS traffic from the vSwitch to the Internet.
3tcp0.0.0.0/032768/65535AllowAllows outbound IPv4 traffic from the vSwitch to the Internet.

This port range is for reference only. For more information on how to select appropriate ephemeral ports, see Ephemeral ports.

4all0.0.0.0/0-1/-1DenyDenies all outbound IPv4 traffic.

Network ACL rules for SLB

If the ECS instance in the vSwitch serves as the backend server of an SLB instance, you must add the following network ACL rules.
  • Inbound rules
    Effective orderProtocolSource IP addressDestination port rangeActionDescription
    1SLB listening protocolClient IP addresses allowed to access the SLB instanceSLB listening portAllowAllows inbound traffic from specified client IP addresses.
    2Health check protocol100.64.0.0/10Health check portAllowAllows inbound traffic from health check IP addresses.
  • Outbound rules
    Effective orderProtocolDestination IP addressDestination port rangeActionDescription
    1allClient IP addresses allowed to access the SLB instance-1/-1AllowAllows all outbound traffic to specified client IP addresses.
    2all100.64.0.0/10-1/-1AllowAllows outbound traffic to health check IP addresses.

Ephemeral ports

Clients use different ports to initiate requests. You can select different port ranges for network ACL rules based on the client type. The following table lists ephemeral port ranges for common clients.
ClientPort range
Linux32768/61000
Windows Server 20031025/5000
Windows Server 2008 or later49152/65535
NAT gateways1024/65535