-
Notifications
You must be signed in to change notification settings - Fork 32
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
Post-up and post-down for firewall rules? #16
Comments
There really should be, I'll implement this when I get time. |
This would be a great addition. What is required to make that work? I took a quick look at the code but could not figure out where that would fit in. |
I'd suggest in the |
This introduces PostUp and PostDown in dsnet. PostUp and PostDown allow the user to run arbitrary commands after the device is up or down. These are typically used to change the firewall rules via iptables. A working example would be ... "PostUp" : "iptables -A FORWARD -i dsnet -j ACCEPT; iptables -A FORWARD -o dsnet -j ACCEPT; iptables -t nat -A POSTROUTING -o ens2 -j MASQUERADE ", "PostDown" : "iptables -D FORWARD -i dsnet -j ACCEPT; iptables -D FORWARD -o dsnet -j ACCEPT; iptables -t nat -D POSTROUTING -o ens2 -j MASQUERADE ", ... All commands are executed by `/bin/sh` and no filtering or sandboxing is applied. Users of this should know what they are doing. Fixes naggie#16
This introduces PostUp and PostDown in dsnet. PostUp and PostDown allow the user to run arbitrary commands after the device is up or down. These are typically used to change the firewall rules via iptables. A working example would be ... "PostUp" : "iptables -A FORWARD -i dsnet -j ACCEPT; iptables -A FORWARD -o dsnet -j ACCEPT; iptables -t nat -A POSTROUTING -o ens2 -j MASQUERADE ", "PostDown" : "iptables -D FORWARD -i dsnet -j ACCEPT; iptables -D FORWARD -o dsnet -j ACCEPT; iptables -t nat -D POSTROUTING -o ens2 -j MASQUERADE ", ... All commands are executed by `/bin/sh` and no filtering or sandboxing is applied. Users of this should know what they are doing. Fixes naggie#16
Hi,
I may have missed something in the docs, but is there a way to specify either a command or a script to run when starting the wg interface with dsnet, similar to the PostUp and PostDown fields in the wireguard config files?
I'm thinking on the server side, when looking at a basic centralised VPN set-up with multiple clients.
The text was updated successfully, but these errors were encountered: