Skip to content
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

Implements PostUp and PostDown commands using /bin/sh #25

Merged
merged 1 commit into from
Nov 19, 2020

Commits on Nov 19, 2020

  1. Implements PostUp and PostDown commands using /bin/sh

    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
    fs111 committed Nov 19, 2020
    Configuration menu
    Copy the full SHA
    e782db3 View commit details
    Browse the repository at this point in the history