Skip to main content
Example of configuring a security group for servers in a private network behind a load balancer
Last update:

Example of configuring a security group for servers in a private network behind a load balancer

carefully

We do not recommend configuring security groups on existing networks, as this can cause load balancer failures and disrupt cloud database replication. To avoid failures and data loss, to configure the groups create a new private network or public subnet и enable traffic filtering (port security) in it.

Purpose of customization

Configure a security group to accept traffic from load balancer on the servers target group.

What you need to customize

In the example, we used a cloud balancer and two cloud servers in one to configure it bullet.

The balancer and servers are located in the private subnet 172.16.0.0/28, online traffic filtering (port security) is enabled. Servers receive TCP traffic from the balancer on port 80, set up. accessibility checks with the PING type.

Customization result

Created and assigned to servers a security group that allows incoming traffic and availability checks to be accepted from the balancer.

All outgoing traffic from the servers is allowed.

Customization steps

  1. В control panels from the top menu, press Products and select Cloud servers.

  2. Go to the section Security groups.

  3. Click Create a security team.

  4. Select pool where the target group's servers are located.

  5. Create a rule in the group that will allow incoming traffic from the balancer.

    5.1. Press Add an incoming traffic rule.

    5.2 Select the protocol — TCP.

    5.3. Select the traffic source (Source) — 5.3. CIDR and enter the IP address of the balancer's subnet, in the example — 172.16.0.0/28. The balancer can recreate with a different IP address within a subnet, so you must specify the entire subnet as the traffic source.

    5.4 Enter the port (Dst. port) on which traffic is allowed to be received, in the example -80.

    5.5 Optional: enter a comment for the rule.

    5.6. Press Add.

  6. Create a rule in the group that will allow availability checks from the balancer:

    6.1. Press Add an incoming traffic rule.

    6.2 Select the protocol — ICMP.

    6.3. Select the traffic source (Source) — 6.3. CIDR and enter the IP address of the balancer's subnet, in the example — 172.16.0.0/28. The balancer can recreate with a different IP address within a subnet, so you must specify the entire subnet as the traffic source.

    6.4 Optional: enter a comment for the rule.

    6.6. Press Add.

  7. In the block Ports check the ports on the target group's servers to which the security group will be assigned. After the group is created, all active sessions that do not comply with the group rules will be terminated on the selected ports.

  8. Enter a name for the group or leave the name created automatically.

  9. Optional: enter a comment for the group.

  10. Click Create a security team.