Configuring Security Group Rules for Backend Servers (Dedicated Load Balancers)
Scenarios
When you add a backend server to a backend server group, ensure that the rules of the security group that containing the backend server allows access from the CIDR block of the VPC where the backend server resides, and that the destination port is that used by the backend server. You also need to configure the protocol and port used for health checks. If you use UDP for health checks, configure a rule to allow ICMP traffic. Otherwise, health checks cannot be performed on the added backend server.
If you have no VPCs when creating a server, the system automatically creates one for you. Default security group rules allow only communications among the servers in the VPC. To ensure that the load balancer can communicate with these servers over both the frontend port and health check port, configure inbound rules for security groups containing these servers.
Procedure
- Log in to the management console.
- In the upper left corner of the page, click
and select the desired region and project. - Under Computing, click Elastic Cloud Server.
- In the ECS list, locate the ECS and click its name.
- Click Security Groups, locate the security group, and view security group rules.
- Click the security group rule ID or Modify Security Group Rule. The security group details page is displayed.
- Under Inbound Rules, click Add Rule.
TCP, HTTP, or HTTPS listeners
- If the health check port is different from the ports of backend servers, the inbound rules must allow TCP traffic from the health check port and backend server ports.
- If you do not specify a health check port, the inbound rules must allow TCP traffic from the ports of backend servers.
- To ensure normal health checks, security group rules must allow traffic from the CIDR block of the subnet where the load balancer resides and allow traffic from the health check port of backend servers and from the ports of backend servers.
UDP listeners
- If the health check port is different from the ports of backend servers, the inbound rules must allow UDP traffic from the health check port and backend server ports.
- If you do not specify a health check port, the inbound rules must allow UDP traffic from the ports of backend servers.
- To ensure normal health checks, security group rules must allow traffic from the CIDR block of the subnet where the load balancer resides and allow traffic from the health check port of backend servers and from the ports of backend servers.
- The inbound rules must allow ICMP traffic.
- Click OK.
Network ACL Rule
A network ACL is an optional subnet-class security configuration. You can associate one or more subnets with a network ACL for controlling traffic in and out of the subnets. Similar to security groups, network ACLs provide access control functions, but add an additional layer of defense to your VPC. Default network ACL rules reject all inbound and outbound traffic. If a network ACL resides in the same subnet as the load balancer or its associated backend servers, the load balancer cannot receive traffic from the public or private network, or backend servers become unhealthy.
Configure an inbound network ACL rule to allow access from the VPC CIDR block to the backend server port.
ACL rules configured for the subnet where the load balancer works will not affect the traffic from the clients to the load balancer. Clients can directly access the load balancer. To control access to load balancer, configure access control for all listeners added to the load balancer.
For details, see Access Control.
- Log in to the management console.
- In the upper left corner of the page, click
and select the desired region and project. - Under Network, click Virtual Private Cloud.
- In the navigation pane on the left, choose Access Control > Network ACLs.
- Locate the network ACL, and click the network ACL name to switch to the network ACL details page.
- On the Inbound Rules or Outbound Rules tab page, click Add Rule to add an inbound or outbound rule.
- Action: Select Allow.
- Protocol: The protocol must be the same as the frontend protocol that was set when the listener was added.
- Source: Set the value to the VPC CIDR block.
- Source Port Range: Select the port range of the service.
- Destination: indicates the destination address allowed in this direction. The default value is 0.0.0.0/0, which indicates that traffic from all IP addresses is permitted.
- Destination Port Range: Select the port range of the service.
- Description: provides supplementary information about the network ACL rule. This parameter is optional.
- Click OK.
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.