-
-
Notifications
You must be signed in to change notification settings - Fork 374
docs: Clarify ARP flux sysctl limitations with host networking #1552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,9 @@ The running environment does not provide the expected kernel sysctl values. This | |
|
|
||
| ## How to Correct the Issue | ||
|
|
||
| Set these sysctls at container runtime. | ||
| ### Option A: Via Docker (Standard Bridge Networking) | ||
|
|
||
| If you are using standard bridged networking (default), set these sysctls at container runtime. | ||
|
|
||
| - In `docker-compose.yml` (preferred): | ||
| ```yaml | ||
|
|
@@ -44,6 +46,24 @@ Set these sysctls at container runtime. | |
| > - Use `--privileged` with `docker run`. | ||
| > - Use the more restrictive `--cap-add=NET_ADMIN` (or `cap_add: [NET_ADMIN]` in `docker-compose` service definitions) to allow the sysctls to be applied at runtime. | ||
|
|
||
| ### Option B: Via Host OS (Required for `network_mode: host`) | ||
|
|
||
| If you are running the container with `network_mode: host`, modern Docker versions (specifically the `runc` runtime) **will not allow** you to set `net.*` sysctls via the container configuration. Attempting to do so will result in an OCI runtime error: `sysctl "net.ipv4.conf.all.arp_announce" not allowed in host network namespace`. | ||
|
|
||
| In this scenario, you must apply the settings directly on your host operating system: | ||
|
|
||
| 1. **Remove** the `sysctls` section from your `docker-compose.yml`. | ||
| 2. **Apply** on the host immediately: | ||
| ```bash | ||
| sudo sysctl -w net.ipv4.conf.all.arp_ignore=1 | ||
| sudo sysctl -w net.ipv4.conf.all.arp_announce=2 | ||
| ``` | ||
| 3. **Make persistent** by adding the following lines to `/etc/sysctl.conf` on the host: | ||
| ```text | ||
| net.ipv4.conf.all.arp_ignore=1 | ||
| net.ipv4.conf.all.arp_announce=2 | ||
| ``` | ||
|
Comment on lines
+49
to
+65
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check if compose files combine network_mode: host with sysctls AND cap_add: NET_ADMIN
for file in docker-compose.yml install/docker/docker-compose.yml install/docker/docker-compose.dev.yml; do
echo "=== $file ==="
echo "Network mode:"
rg 'network_mode.*host' "$file"
echo "Capabilities:"
rg -A5 'cap_add:' "$file" | head -10
echo "Sysctls:"
rg -A2 'sysctls:' "$file"
echo ""
doneRepository: netalertx/NetAlertX Length of output: 1817 Option B oversimplifies and contradicts actual supported configuration. This section claims that "modern Docker versions (specifically the The critical detail is that with Revise Option B to acknowledge that the 🤖 Prompt for AI Agents |
||
|
|
||
| ## Additional Resources | ||
|
|
||
| For broader Docker Compose guidance, see: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,9 @@ if [ "$failed" -eq 1 ]; then | |
| net.ipv4.conf.all.arp_ignore=1 | ||
| net.ipv4.conf.all.arp_announce=2 | ||
|
|
||
| Note: If using 'network_mode: host', you cannot set these via docker-compose | ||
| sysctls. You must configure them directly on your host operating system instead. | ||
|
Comment on lines
+25
to
+26
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guidance contradicts learned behavior with NET_ADMIN capability. The note states "you cannot set these via docker-compose sysctls" when using
The actual behavior is capability and version-dependent, not a blanket prohibition. All existing compose files in this repository successfully combine Based on learnings, when a Docker Compose service uses 🤖 Prompt for AI Agents |
||
|
|
||
| Detection accuracy may be reduced until configured. | ||
|
|
||
| See: https://docs.netalertx.com/docker-troubleshooting/arp-flux-sysctls/ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: netalertx/NetAlertX
Length of output: 1079
Major documentation error: Guidance contradicts the working baseline configuration and established behavior.
The comment claims that "modern Docker/runc will correctly block sysctl overrides" with
network_mode: hostand instructs users to "REMOVE the sysctls block below" when using host mode. This is contradicted by three critical facts:All baseline compose files in this repository use both
network_mode: hostAND these sysctls together (docker-compose.yml, install/docker/docker-compose.yml, and install/docker/docker-compose.dev.yml all combine them successfully).The baseline defaults to host networking (line 21:
network_mode: ${NETALERTX_NETWORK_MODE:-host}), yet the new comment instructs removal of sysctls for host mode. This internal contradiction proves the guidance is incorrect.Established behavior confirms sysctls work with host networking + NET_ADMIN capability—they are accepted in practice and modify the host's network namespace directly, exactly as intended for ARP flux mitigation.
The documentation should be corrected to reflect actual working behavior instead of providing incorrect guidance that contradicts the codebase itself.
🤖 Prompt for AI Agents