Commit Graph

11 Commits

Author SHA1 Message Date
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
c8c27e8ce0
add IPv6 to interface 2020-10-30 12:34:35 +00:00
Callan Bryant
b6bd2d33e1
move sync fn to sync.go 2020-03-04 22:50:44 +00:00
Callan Bryant
1572a78d6c
check error in correct place 2020-03-04 22:04:13 +00:00
Callan Bryant
f00e344a72
separate link creation / device configuration 2020-03-04 22:01:30 +00:00
Callan Bryant
ccc45f8368
close wg client 2020-03-04 21:18:34 +00:00
Callan Bryant
f4a41b5c42
also bring iface up 2020-03-04 21:09:12 +00:00
Callan Bryant
862cc820bc
correct mask 2020-03-04 20:34:11 +00:00
Callan Bryant
e5dcbd8e35
successful adding of peers! 2020-03-04 20:30:05 +00:00
Callan Bryant
deef2574e7
add dead codde to bring up iface 2020-03-04 19:56:57 +00:00
Callan Bryant
4bb17e043f
start attempt at interface creation 2020-03-04 19:43:54 +00:00