Firewall rules
The firewall controls a VM's internet traffic over IPv4 and IPv6. New inbound connections are denied until you add a rule — including SSH. Rules live on each VM under VM → networking.
Rule types
- Inbound — connections from the internet to the VM, matched on source CIDRs.
- Outbound — connections from the VM to the internet, matched on destination CIDRs.
- Port forwarding — sends a port on one of the VM's public IPs to a different port on the VM, for example public
2222to VM22. TCP or UDP, IPv4 only, single ports (no ranges).
Rule fields
| Field | Values |
|---|---|
| Action | allow or deny |
| Protocol | TCP, UDP, or ICMP (ICMP has no ports) |
| Port or range | one port, or an inclusive range such as 30000–32767 |
| Source / destination CIDRs | up to 32, IPv4 or IPv6; empty means any address |
| IP family | IPv4, IPv6, or both |
| Priority | 1–1000; lower numbers win, deny wins a tie, and rules without a priority come last |
| Client source port | optional range of the remote side's port (advanced) |
Allow SSH from your office
VM → networking → Add inbound rule, then choose TCP, port 22, source
203.0.113.7/32, and a name like "SSH from office". The
sheet previews the rule in plain words before you add it, and the list
shows when it has been applied.
Remember IPv6: a rule with an IPv4 source only covers IPv4. Add an IPv6 source too if you connect over IPv6.
Block something broad, allow something narrow
Use priorities to layer rules. For example, allow TCP 443 from
198.51.100.0/24 at priority 10 and deny TCP 443 from
anywhere at priority 20: the narrower allow wins for that network, and
everyone else is refused.
Outbound and internet access
Outbound traffic is also governed by the VM's Internet access settings on the same tab:
- Outbound internet — new connections from the VM to the internet, through its public IPv4 or shared NAT. Replies to allowed inbound connections always work.
- IPv6 internet — internet traffic on the VM's routed IPv6 /64, in both directions. The VM keeps its addresses either way.
Outbound rules narrow what's allowed when outbound internet is on. If your outbound rules only cover IPv4, IPv6 outbound stays unrestricted — add an IPv6 outbound rule or turn IPv6 internet off.
Firewall vs. security groups
The firewall covers traffic between the VM and the internet. Traffic between your VMs on private networks is controlled by security groups. A rule in one never affects the other.
Remove a rule
Remove rules from the list on the VM's networking tab. Removing a rule can interrupt connections, including SSH, and takes effect once its operation completes.
What's next
- Public IPs and Public IPv6 — the addresses these rules protect.
- Security groups — VM-to-VM policy.
- Create a VM.