Commit Graph

43 Commits

Author SHA1 Message Date
Callan Bryant
45b61f8a63
support ExternalHostname which has precedence over IPs 2020-11-29 18:34:05 +00:00
Callan Bryant
dea2e86bc6
go fmt 2020-11-19 22:57:29 +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
f1e1a6838f
fix allowedIPs construction where networks are provided 2020-11-02 17:56:12 +00:00
Callan Bryant
0481996116
add allowedIPs conditionally 2020-10-27 21:57:44 +00:00
Callan Bryant
a6bacff44d
update getwgpeerconfgs 2020-10-27 21:42:21 +00:00
Callan Bryant
5a870dab60
use ExternalIP6 if ExternalIP not available 2020-10-26 18:27:35 +00:00
Callan Bryant
608dbf176f
check config contains external IPv6/IPv4 2020-10-26 18:11:56 +00:00
Callan Bryant
f57fa3473d
fix lookup of v6: do not require 2020-10-26 17:58:15 +00:00
Callan Bryant
d58b2f5a54
detect IPv6 and IPv4 for server 2020-10-26 08:27:22 +00:00
Callan Bryant
9a942c1040
remove debug 2020-10-25 21:02:06 +00:00
Callan Bryant
cb75689825
move allocation out of loop 2020-10-25 14:59:46 +00:00
Callan Bryant
19f25ff847
working psudorandom v6 allocator 2020-10-25 14:57:18 +00:00
Callan Bryant
af3e1b2ea9
make allocation universal, given a network 2020-10-25 08:23:43 +00:00
Callan Bryant
330b986aa4
ipallocated -- also check ipv6 2020-10-24 21:08:12 +01:00
Callan Bryant
6d9c9c1912
remove ipVersion type 2020-10-24 21:06:28 +01:00
Callan Bryant
055a1adce3
add ipversion type 2020-10-24 21:06:15 +01:00
Callan Bryant
d07d267c78
add IPv6 attrs to config + go fmt 2020-10-24 20:51:47 +01:00
Callan Bryant
2d7447c32c
fix preservation of order on remove 2020-04-04 09:22:09 +01:00
Callan Bryant
c95e225de8
revise possible statuses 2020-03-20 23:12:19 +00:00
Callan Bryant
1e046a20a1
record added time 2020-03-19 20:12:42 +00:00
Callan Bryant
3277362e6e
no DNS by default 2020-03-16 19:29:16 +00:00
Callan Bryant
ea5ffaa4e2
support peer networks in allowedIPs 2020-03-12 20:08:21 +00:00
Callan Bryant
130d3ba8cc
move networks after dns 2020-03-08 20:49:35 +00:00
Callan Bryant
d250f2b23b
support additional networks 2020-03-08 20:48:10 +00:00
Callan Bryant
882643185b
bugfix: prevent same PSK for all peers 2020-03-08 14:10:38 +00:00
Callan Bryant
17b0ad74ae
peer online count in report 2020-03-07 21:57:00 +00:00
Callan Bryant
5f623dcd9d
no keepalive from server to client 2020-03-07 10:07:03 +00:00
Callan Bryant
3c8ba7e3bc
read old report for later use 2020-03-05 23:56:24 +00:00
Callan Bryant
78b28be231
correct distribution of PSKs 2020-03-05 22:18:21 +00:00
Callan Bryant
8c5aaee793
compute peer status (incomplete) 2020-03-05 22:05:47 +00:00
Callan Bryant
c579372eaa
Revert "embed types without alias properly"
This reverts commit b7ed21f2ec.
2020-03-05 20:59:56 +00:00
Callan Bryant
b7ed21f2ec
embed types without alias properly 2020-03-05 20:46:28 +00:00
Callan Bryant
0380753104
add remove cmd 2020-03-05 20:35:51 +00:00
Callan Bryant
f00e344a72
separate link creation / device configuration 2020-03-04 22:01:30 +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
d81bd72a5f
make networks required for peer 2020-03-04 19:46:39 +00:00
Callan Bryant
4bb17e043f
start attempt at interface creation 2020-03-04 19:43:54 +00:00
Callan Bryant
b87948de55
enable validation where appropriate 2020-03-03 23:09:54 +00:00
Callan Bryant
020de337ce
check config file early for init/add 2020-03-03 22:33:48 +00:00
Callan Bryant
c2aac62f27
deal with private IP separately 2020-03-03 22:30:36 +00:00
Callan Bryant
5cc866fe77
separate config types from report types 2020-03-03 22:08:52 +00:00