> For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://ibee.ai/docs/llms.txt (full text of every page: https://ibee.ai/docs/llms-full.txt). For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://ibee.ai/docs/_mcp/server. # Firewalls > Control which traffic reaches your IBEE VMs with firewall groups. What the default group allows, what happens with no rules, whether replies and outbound traffic are filtered, how groups work with the firewall inside the VM, and the limits. A **firewall group** is a named list of rules that decides which incoming traffic may reach your VMs. You attach the group to one or more VMs, and IBEE checks every incoming packet against its rules before it reaches the VM. Traffic that no rule accepts is dropped, so a VM is closed by default except for the ports you open. ## When to use a firewall group | You want to… | Use | Why | | --------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | | Allow only some ports or addresses to reach a VM, for example SSH from your office only | **Firewall group** (this page) | Filters traffic before it reaches the VM, for every VM in the group at once | | Add a second layer of filtering, or filter by app or user | The firewall inside the VM (`ufw`, `firewalld`, Windows Defender Firewall) | Runs in the guest OS; it adds to the firewall group, it doesn't replace it | | Keep a VM off the internet entirely | A [VPC](/docs/network-security/vpc-ip-management) with **Private only** | The VM has no public address at all | | Open one port on a private VM | [NAT port forwarding](/docs/network-security/vpc-ip-management#nat-port-forwarding) | NAT (network address translation) maps a port on the VPC's shared public address to the VM | Traffic must pass **both** the firewall group and the firewall inside the VM. If either one blocks a port, the connection fails. ## How it works 1. **Rules are checked at the VM's virtual network port,** outside the VM. A dropped packet never reaches the VM. 2. **Firewall groups are stateful.** When a rule accepts a connection, the replies to it are allowed automatically. You don't need rules for return traffic. 3. **Incoming traffic that no rule accepts is dropped.** Every group ends with a system rule, "Default deny all other inbound IPv4". 4. **A drop rule beats an accept rule.** If a **drop** rule and an **accept** rule both match the same traffic, the traffic is dropped, whatever their order in the list. 5. **Outgoing traffic is allowed.** Every group has a system rule, "Allow all outbound IPv4". The portal shows inbound rules only. ## The default firewall group Every VM is in exactly one firewall group. A new VM goes into the platform's default group unless you pick one of yours when you deploy it. In the Firewalls list, the default group is marked **(default)**. The default group accepts these from any address, and drops all other inbound traffic: | Port | Protocol | Usually used by | | ------------- | -------- | ---------------------------- | | `22` | TCP | SSH | | `3389` | TCP | Windows Remote Desktop (RDP) | | `80` | TCP | HTTP websites | | `443` | TCP | HTTPS websites | | `8000`–`8080` | TCP | App servers | The default group doesn't accept ICMP, so `ping` to a VM in it gets no answer. You can't edit the default group's rules or attach VMs to it yourself. To open other ports, or to close the ones above, create your own group and attach your VM to it. Detaching a VM from your group puts it back in the default group. ## Before you begin * **A verified organization.** Until it's verified, creating groups or rules asks you to verify first. See [Verify your identity](/docs/getting-started/account-setup/verify-your-identity). * **The VMs you want to protect,** in the same workspace. * **The ports your apps use,** and, if you want to limit who can connect, the addresses allowed in. Find your own public IPv4 address by searching "what is my IP" in a browser. * **For the API:** an [API token](/docs/tools/api-tokens) with **Firewall** permission (`firewall.read`, `firewall.write`) and your workspace ID. ## Create a group and attach a VM ### Open Firewalls In the sidebar, under **Network & Security**, click **Firewalls**. The list shows each group's **Name**, **Description**, **Rules**, **Linked Instances** and **Updated** time, 10 groups per page. ### Create the group Click **Create Firewall Group**. In the dialog, enter a **Group name** (up to 120 characters, for example `web-tier`) and click **Create Group**. You see "Firewall group created." ### Add rules Click the group's name to open it. On the **IPv4 Rules** tab, add the rules you need. Keep a rule for the way you manage the VM (SSH on port `22` or RDP on port `3389`). See [Create firewall rules](/docs/network-security/firewalls/create-firewall-rules). ### Attach VMs Click the **Linked Instances** tab. Search for an active VM and click **Attach**. You see "Instance attached to firewall group." If the VM was in another group, it moves to this one. > **Warning** > > Add your SSH or RDP rule **before** you attach a VM. A new group drops all inbound traffic until you add accept rules, so attaching it first cuts off your own access. ## Verify From a computer outside IBEE, test an open port and a closed one: ```bash nc -vz -w 5 203.0.113.10 22 # open: "succeeded" or "open" nc -vz -w 5 203.0.113.10 5432 # closed: gives up ``` `-w 5` makes `nc` give up after 5 seconds. A port the firewall drops waits the full 5 seconds and then fails, instead of being refused at once, because the firewall doesn't answer. On Windows, use `Test-NetConnection 203.0.113.10 -Port 22` in PowerShell. ## Manage groups * **Open a group:** click its name. The page shows **Group Rules** (the number of inbound rules, out of 50) and **Linked Instances**. * **Copy the ID:** open the group's menu in the list and click **Copy ID**. The API calls this the `firewall_group_id`. * **Detach a VM:** on **Linked Instances**, click **Detach** on the VM's row. The VM goes back to the default group. * **Delete a group:** open its menu in the list, click **Delete**, type the group's name in the **Delete Firewall** dialog, and confirm. The VMs in it go back to the default group. This can't be undone. * **Rename a group:** the menu shows **Rename**, but it isn't available yet. ## Use the API Create a group, add a rule that accepts HTTPS from anywhere, and attach a VM. Replace `710995` with your workspace ID. ```bash # 1. Create the group curl -X POST "https://api.ibee.ai/v1/networking/firewall-groups?workspace_id=710995" \ -H "Authorization: Bearer $IBEE_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name": "web-tier"}' # 2. Add a rule (use the firewall_group_id from step 1) curl -X POST "https://api.ibee.ai/v1/networking/firewall-groups/FIREWALL-GROUP-ID/rules?workspace_id=710995" \ -H "Authorization: Bearer $IBEE_TOKEN" \ -H "Content-Type: application/json" \ -d '{"protocol": "tcp", "port_start": 443, "action": "allow", "remote_targets": ["0.0.0.0/0"], "description": "HTTPS"}' # 3. Attach a VM curl -X POST "https://api.ibee.ai/v1/networking/firewall-groups/FIREWALL-GROUP-ID/attachments?workspace_id=710995" \ -H "Authorization: Bearer $IBEE_TOKEN" \ -H "Content-Type: application/json" \ -d '{"vm_id": "VM-ID"}' ``` | Task | Operation | | ---------------------------- | --------------------------------------------------------------------------------------------- | | List groups | `GET /networking/firewall-groups` (10 per page by default; `limit` up to `100`, and `offset`) | | Get or delete a group | `GET` or `DELETE /networking/firewall-groups/FIREWALL-GROUP-ID` | | Add, change or delete a rule | `POST .../rules`, `PATCH` or `DELETE .../rules/RULE-ID` | | List, attach or detach VMs | `GET` or `POST .../attachments`, `DELETE .../attachments/VM-ID` | In the API, the portal's **accept** is `allow`. The API also accepts outbound rules (`"direction": "egress"`; egress means traffic leaving the VM), a rule `priority`, and `"enabled": false` to switch a rule off; the portal doesn't show these. ## Limits | Item | Limit | | ----------------------- | ---------------------------------------------------------------------- | | Groups per VM | `1` at a time | | Group name | 1–120 characters, unique in the workspace | | Inbound rules per group | The group page counts them out of 50 | | Protocols | Any, TCP, UDP, ICMP | | Ports | `1`–`65535`, one port or a range per rule | | Addresses | IPv4 only; IPv6 rules are "Coming soon" | | When a change applies | As soon as **Save** (or **Attach**) finishes, on every VM in the group | ## Security tips * **Open only the ports you use.** Every open port is a way in. * **Limit SSH and RDP to known addresses,** such as your office or VPN, with a **Custom** source. * **Keep databases off the internet.** Don't open `3306` or `5432` to **Anywhere**; allow only your app servers' addresses, or keep the database in a [VPC](/docs/network-security/vpc-ip-management). * **Review groups regularly,** and remove rules and VMs you no longer need. ## Troubleshooting | You see | What it means | What to do | | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------- | | A connection times out after you attach a new group | The group has no accept rule for that port | Add an **accept** rule for the port, or detach the VM to go back to the default group. | | The port is open in the group but the connection is still refused or times out | The firewall inside the VM blocks it, or nothing listens on the port | Check `sudo ufw status` or `sudo firewall-cmd --list-all`, and `sudo ss -tlnp` to see what listens. | | `ping` gets no answer | ICMP isn't accepted | Add an **accept** rule with protocol **ICMP**. | | Traffic is still blocked although an accept rule matches | A **drop** rule also matches, and drop wins | Remove or narrow the drop rule. | | The VM can't be found under **Attach** | Only active VMs in this workspace are listed | Start the VM, or switch to the workspace it's in. | | No **Attach** or **Detach** buttons | You opened the default group | Attach VMs to one of your own groups instead. | | "A firewall group with this name already exists." | Names must be unique in the workspace (upper and lower case count as the same) | Choose another name. | | "Firewall group creation failed" | The request failed | Try again. If it repeats, contact support. | | "Firewall group deletion failed" | The deletion didn't complete | Refresh the page and try again. If it repeats, contact support. | ## Related pages * [Create firewall rules](/docs/network-security/firewalls/create-firewall-rules) * [Networking for VMs](/docs/infrastructure/cloud-vms/networking-for-vms) * [VPC & IP management](/docs/network-security/vpc-ip-management) * [Load Balancers](/docs/network-security/load-balancer) ## Docs - [Create firewall rules](https://ibee.ai/docs/network-security/firewalls/create-firewall-rules.md): Add, change and delete inbound rules in an IBEE firewall group — every field and default, how to allow one address or a range (CIDR), safe starting rule sets, outbound rules with the API, and the exact error messages.