Security groups
How to use security groups to control inbound and outbound network traffic to your servers.
What a security group is
A security group is a collection of servers that filter their inbound and outbound traffic according to a set of rules -- "ingress" and "egress" rules. The rules determine which IP addresses may communicate with the server, and on which ports.
Every account starts with a default security group that blocks all inbound traffic and allows all outbound traffic. You can change the default group so new servers inherit a different rule set, or create as many additional security groups as you need.
A server can belong to several security groups at once. You can only change a server's security groups while it is stopped -- a running server cannot be moved between groups.
If no ingress rules are specified, no inbound traffic is allowed -- apart from replies to traffic already permitted outbound by an egress rule.
Add a security group
- Select Network in the left-hand navigation.
- Select Security groups in the view.
- Click Add security group.
- Enter a name and a description.
- Click OK.
The new security group now appears under Security groups. It only becomes useful once you have added rules to it -- see the next section.
Add ingress and egress rules
- Open the security group you want to edit.
- For an inbound (ingress) rule: click the Ingress Rules tab and specify:
- Add by CIDR/Account: whether the source of the traffic is given as an IP range (CIDR) or as an existing security group on an account.
- Protocol: TCP, UDP or ICMP.
- Start Port / End Port (TCP/UDP): the port range to open. Use the same port number in both fields to open a single port.
- ICMP Type / ICMP Code (ICMP only).
- CIDR: for example
0.0.0.0/0to allow all IPv4 traffic, or::/0for all IPv6 traffic.
- For an outbound (egress) rule: the same fields under the Egress Rules tab.
- Click Add.
Note:
- If a group has no egress rules, all outbound traffic is allowed.
- If it has egress rules, only traffic matching a rule is allowed -- everything else is blocked.
- Only inbound traffic matching an ingress rule is allowed in.
Security groups in advanced zones (KVM only)
In an advanced zone where KVM is the hypervisor, security groups can be used to isolate servers on a single shared, zone-wide network -- instead of creating separate isolated networks per customer. Both IPv4 and IPv6 are supported.