---
title: "Firewalls"
description: "Admit a load balancer to your targets with a firewall rule that names it."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Firewalls

Your targets' [firewalls](/compute/firewalls) must admit the load balancer, on the target port and on
the health check port if that's different. Without that, health checks time out and targets stay
`unhealthy` with `health_check_timed_out`.

A target on its VPC's [default firewall](/compute/firewalls#vpc-default-firewalls) already admits it,
with nothing to do. The rest of this page is for your own firewalls.

Add a rule whose peer is the load balancer. It stays right however the load balancer changes, and
you never need to know its addresses.

```json
{
  "direction": "inbound",
  "protocol": "tcp",
  "ports": { "from": 8080, "to": 8080 },
  "peer": { "loadBalancer": "lbr_4k2m9x0a7qpe" }
}
```

```sh
ezgh compute firewalls rules add web --direction inbound --protocol tcp \
  --ports 8080 --peer-load-balancer lbr_4k2m9x0a7qpe
```

In the console, the rule editor offers **Load balancer** as a source. When a target's health checks
time out on a network interface whose firewalls don't admit its load balancer, the target group's
page offers to add the rule.

- Each load balancer you admit takes one of an interface's 8 firewall references.
- You need `lb.loadBalancers.get` on the load balancer to name it in a rule.
- A load balancer in a rule can't be deleted: delete the rule first.
- A rule allowing a CIDR that covers the load balancer's subnet works too, but it also admits
  everything else in that range.

Clients are limited on the listener, by its [allowed sources](/load-balancers#listeners), not on your
targets' firewalls: to your targets, every connection comes from the load balancer.

Source: https://docs.ezghcloud.com/load-balancers/firewalls/index.mdx
