-
-
Notifications
You must be signed in to change notification settings - Fork 244
Add UFW configuration to the wireguard internal docs #1205
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: master
Are you sure you want to change the base?
Changes from 2 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 |
|---|---|---|
|
|
@@ -84,6 +84,31 @@ The rules will then be cleared once the tunnel is down. | |
|
|
||
| The important change is the extra `PostUp` and `PostDown` in the `[Interface]` section. | ||
| <!-- markdownlint-enable code-block-style --> | ||
|
|
||
| ### `ufw` | ||
|
|
||
| If you are using UFW the above doesn't work and you will need to edit `/etc/ufw/before.rules`: | ||
|
|
||
| Insert this into the before.rules file but **before** the FIRST commit line: | ||
|
Member
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.
|
||
|
|
||
| ```bash | ||
| # allow forwarding for trusted network | ||
| -A ufw-before-forward -s 10.10.10.0/24 -j ACCEPT | ||
| -A ufw-before-forward -d 10.10.10.0/24 -j ACCEPT | ||
|
Comment on lines
+96
to
+97
Member
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. Blocking: this guide uses |
||
| ``` | ||
|
|
||
| For IPv6 you need to do the same but at `/etc/ufw/before6.rules`: | ||
|
|
||
| Put the following near the bottom but **before** the first COMMIT line: | ||
|
|
||
| ```bash | ||
| # allow forwarding for trusted network | ||
| -A ufw6-before-forward -s fd08:4711::/64 -j ACCEPT | ||
| -A ufw6-before-forward -d fd08:4711::/64 -j ACCEPT | ||
| ``` | ||
|
|
||
| Restart ufw for the changes to take effect: `systemctl restart ufw` | ||
|
Member
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. The rest of the guide prefixes root commands with |
||
|
|
||
| ## Allow clients to access other devices | ||
|
|
||
| In our standard configuration, we have configured the clients in such a way that they can only speak to the server. Add the network range of your local network in CIDR notation (e.g., `192.168.2.1 - 192.168.2.254` -> `192.168.2.0/24`) in the `[Peers]` section of all clients you want to have this feature: | ||
|
|
||
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.
UFW does not replace the NAT rules above - the
nftables/iptablesmasquerade still runs; UFW just drops forwarded packets on top of it. Could we reword along the lines of:As-is, "the above doesn't work" reads as if UFW were an alternative to the
nftables/iptablesmethod rather than an extra step on top of it.