Commit Graph

12 Commits

Author SHA1 Message Date
Callan Bryant
08b8372148
apply rule of silence to up/down cmds 2020-11-19 22:57:02 +00:00
Andre Kelpe
e782db30e9 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 https://github.com/naggie/dsnet/issues/16
2020-11-19 23:21:11 +01:00
Callan Bryant
d07d267c78
add IPv6 attrs to config + go fmt 2020-10-24 20:51:47 +01:00
Callan Bryant
a4b900dee7
Merge pull request #18 from botto/fail-on-no-internet
Fail on no internet
2020-09-08 08:12:18 +01:00
Martin Eskdale Moen
a8926aaab6 Include a custom message if there is an error
This change lets us include a custom message if there is an error
2020-09-07 17:22:24 +01:00
Martin Eskdale Moen
ce1b1dd9ff Added xmit bytes to interface report 2020-05-28 15:50:19 +01:00
Callan Bryant
9068c861f5
add SI bytes TXRX 2020-03-06 22:32:04 +00:00
Callan Bryant
1011cf5e66
use ExitFail instead of panic 2020-03-03 23:11:54 +00:00
Callan Bryant
1fdf4fe71f
prompts: stderr< + misc 2020-03-02 21:36:41 +00:00
Callan Bryant
c419dfed48
fn/method to load/save conf 2020-03-02 02:54:43 +00:00
Callan Bryant
bba8662ab9
add prompts for add cmd 2020-03-02 02:17:30 +00:00
Callan Bryant
2c3bb65612
error() check 2020-03-01 23:48:02 +00:00