# No buffer space available

Log entry:

```
ERROR defguard_gateway::gateway Failed to update network configuration: Firewall error: Netlink error: Failed while reading a message from socket: Os { code: 105, kind: Uncategorized, message: "No buffer space available" }
```

This error means the kernel socket receive/send buffers are too small for the volume of netlink messages the gateway is generating. This typically occurs on gateways with many peers or high peer churn.

### Fix

Increase the kernel socket buffer sizes. Add the following to `/etc/sysctl.conf`:

```ini
net.core.rmem_max = 67108864
net.core.wmem_max = 67108864
net.ipv4.tcp_rmem = 4096 87380 67108864
net.ipv4.tcp_wmem = 4096 65536 67108864
net.core.rmem_default = 524288
net.core.wmem_default = 524288
```

Apply without rebooting:

```sh
sudo sysctl -p
```

Restart the gateway service after applying:

```sh
sudo systemctl restart defguard-gateway
```

More context: [github.com/DefGuard/defguard/issues/1303](https://github.com/DefGuard/defguard/issues/1303)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.defguard.net/support-1/troubleshooting-guides/gateway/no-buffer-space-available.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
