-
Notifications
You must be signed in to change notification settings - Fork 143
Document what the client --disable-firewall flag turns off #968
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
Open
lixmal
wants to merge
2
commits into
main
Choose a base branch
from
document-disable-firewall
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+103
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| import {Note} from "@/components/mdx"; | ||
|
|
||
| # Disable Firewall Configuration | ||
|
|
||
| `--disable-firewall` tells the NetBird client not to create a firewall manager at all. The client then adds no firewall rules of its own, and every feature that is built on firewall rules stops working with it. | ||
|
|
||
| This is a bigger switch than the name suggests. The firewall manager is not only where access control policies land: NAT for routed traffic, the DNS port 53 redirect and the userspace packet filter all live there too. Use it on hosts whose firewall is managed entirely outside NetBird, and read the list below first. | ||
|
|
||
| ## Enabling and clearing it | ||
|
|
||
| ```bash | ||
| netbird up --disable-firewall | ||
| ``` | ||
|
|
||
| The equivalent environment variable is `NB_DISABLE_FIREWALL=true`. | ||
|
|
||
| The setting is stored in the profile configuration, so it survives reconnects and service restarts. Passing it to `netbird up` while the client is already connected has no effect: run `netbird down` first, or pass it together with the initial login. | ||
|
|
||
| ```bash | ||
| netbird up --disable-firewall=false | ||
| ``` | ||
|
|
||
| A [debug bundle](/help/troubleshooting-client#debug-bundle) records the current value as `DisableFirewall` in the client configuration dump, which is the quickest way to tell whether a peer is running with the flag. | ||
|
|
||
| ## What stops working | ||
|
|
||
| ### Access control policies | ||
|
|
||
| Without a firewall manager the client installs neither the default drop rule for its interface nor the accept rules derived from your [access control policies](/manage/access-control). Inbound peer traffic is not filtered at all: any peer that can reach this one over the overlay gets through, whatever your policies say. | ||
|
|
||
| [`--block-inbound`](/client/block-inbound-connections) stops working for the same reason. It blocks by *withholding* the accept rules so that the default drop applies, and with the firewall disabled there is no default drop left to fall back on. `--block-lan-access` is a firewall rule too, and is likewise not installed. | ||
|
|
||
| <Note> | ||
| Combining `--disable-firewall` with `--block-inbound` does not lock a peer down. It leaves it fully open. | ||
| </Note> | ||
|
|
||
| ### Routing peers and exit nodes | ||
|
|
||
| The peer cannot serve routes. NAT/masquerading, the forwarding rules and the route-level [access control](/manage/network-routes/access-control) for [network routes](/manage/network-routes) and [networks](/manage/networks) all come from the firewall manager, so a peer started with `--disable-firewall` will not work as a routing peer or as an exit node. | ||
|
|
||
| Using *another* peer as a routing peer or exit node is unaffected: client routes are installed in the operating system's routing table, not in the firewall. | ||
|
|
||
| ### The DNS port 53 redirect | ||
|
|
||
| In kernel mode the local resolver binds port 53 on the NetBird interface address, `127.0.0.1` or `127.0.0.153`. When port 53 is taken on all of them, which is the case on a host that runs its own DNS server such as `dnsmasq` or Pi-hole, the resolver falls back to another port and the client redirects port 53 to it with DNAT rules. | ||
|
|
||
| Those rules need the firewall manager. Without it the resolver answers only on its fallback port while the system keeps sending queries to port 53, and resolution through NetBird stops until port 53 is free again. A peer whose port 53 is free is unaffected, which is the common case. | ||
|
|
||
| On a routing peer, the DNS forwarder that resolves [domain-based network resources](/manage/networks) also depends on the firewall: its port is not opened, the redirect for the forwarder port is not installed, and the address sets behind domain resource access control are not updated. Domain resources served by that peer will not resolve. | ||
|
|
||
| ### Integration with the host firewall | ||
|
|
||
| The client normally opens its interface in the host's own filter chains and marks it trusted in `firewalld`. That stops as well. On a host with a restrictive `INPUT` policy (`firewalld`, `ufw`, or a hand-written `nftables` ruleset), the host's own rules can now drop NetBird traffic, including queries to the local resolver. You have to allow the NetBird interface yourself. | ||
|
|
||
| ### Traffic events in userspace mode | ||
|
|
||
| Flow tracking lives in the userspace packet filter, so [traffic events](/manage/activity/traffic-events-logging) stop being reported in userspace mode. In kernel mode the flow data comes from a separate conntrack reader and is unaffected. | ||
|
|
||
| ## What keeps working | ||
|
|
||
| - Peer-to-peer and relayed connectivity, and the data path itself. | ||
| - Client routes: using another peer as a routing peer or exit node. | ||
| - The local DNS resolver, along with the nameserver and search domain configuration the client applies to the operating system, except for the port 53 redirect described above. | ||
|
|
||
| ## Narrower alternatives | ||
|
|
||
| If the goal is to keep NetBird away from part of your firewall configuration rather than all of it: | ||
|
|
||
| - `--disable-server-routes` stops the peer from acting as a routing peer, without giving up access control enforcement. | ||
| - [`--block-inbound`](/client/block-inbound-connections) blocks all inbound traffic while keeping the firewall in place, which is what most "lock this peer down" cases actually want. | ||
| - `NB_NFTABLES_TABLE` renames the `nftables` table the client creates, for hosts where the default name collides with existing configuration. | ||
| - `NB_SKIP_NFTABLES_CHECK` sends the client straight to the iptables backend on hosts where `nftables` is present but not functional. | ||
|
|
||
| See [Client Environment Variables](/client/environment-variables) for the full list. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.