Project

General

Profile

The ungleich VPN infrastructure » History » Version 12

Nico Schottelius, 01/25/2019 06:02 PM

1 1 Nico Schottelius
h1. The ungleich VPN infrastructure
2
3 5 Nico Schottelius
{{toc}}
4
5 11 Nico Schottelius
h2. Status
6
7
This document is *IN PRODUCTION*.
8
9 1 Nico Schottelius
h2. Wireguard on vpn-2a0ae5c1.ungleich.ch
10
11
* Server: vpn-2a0ae5c1.ungleich.ch
12
* Port: 51820
13
* Requires a public key
14 7 Nico Schottelius
* Client network: 2a0a:e5c1:100::/40
15 1 Nico Schottelius
* Client network size: /48
16
17 9 Nico Schottelius
h3. How to add a new customer connection
18 1 Nico Schottelius
19 9 Nico Schottelius
* Get the public key of the customer
20
* Edit dot-cdist/type/__ungleich_wireguard/manifest and add the new network definition at the end of the file
21
* Let the customer know their network
22 1 Nico Schottelius
23 9 Nico Schottelius
h3. Sample clustomer client configuration
24
25
* "Install wireguard":https://www.wireguard.com/install/
26
* Create your private key: @umask 077; wg genkey > privkey@
27
* Get your public key: @wg pubkey < privkey@
28
** You need to send this pubkey to ungleich
29
* You will get your network definition after we have received your public key
30
* Create /etc/wireguard/wg0.conf
31
32 1 Nico Schottelius
<pre>
33
[Interface]
34
PrivateKey = YOURKEYHERE
35 12 Nico Schottelius
Address = YOURIPv6IPADDRESSHERE/48
36 1 Nico Schottelius
ListenPort = 51280
37
38
[Peer]
39 9 Nico Schottelius
PublicKey = hi60lGP+xEUQ+kVnqA7PlJAO1SVqTS1W36g0LhFP0xQ=
40 1 Nico Schottelius
Endpoint = vpn-2a0ae5c1.ungleich.ch:51820
41
AllowedIPs = ::/0
42
</pre>
43
44
Commands for setting it up
45
46
<pre>
47
MY_NET=2a0a:e5c1:XXXX::1/48
48
49
ip link add dev wg0 type wireguard
50
51
# Replace with your range
52
ip addr add $MY_NET dev wg0
53
54
# Add routing
55
ip route add 2a0a:e5c1:100::/40 dev wg0
56
ip route add ::/0 via 2a0a:e5c1:100::1
57
58
# Configure the interface
59
wg setconf wg0 /etc/wireguard/wg0.conf
60
61
# Bring it up
62
ip link set wg0 up
63
</pre>
64 12 Nico Schottelius
65
Once it runs, you can also use @wg-quick@ to get it up faster:
66
67
<pre>
68
wg-quick up wg0
69
</pre>
70
71
(this just requires a configuration file named /etc/wireguard/wg0.conf to be existing)
72 1 Nico Schottelius
73
Debugging
74
75
* wg show
76
* ping 2a0a:e5c1:100::1
77 6 Nico Schottelius
78
h3. Sample server configuration
79 1 Nico Schottelius
80 10 Nico Schottelius
This is just for reference - as a client you don't need this configuration
81
82 6 Nico Schottelius
/etc/wireguard/wg0.conf:
83
84
<pre>
85
[Interface]
86
ListenPort = 51820
87 7 Nico Schottelius
PrivateKey = SERVERKEYHERE
88 6 Nico Schottelius
89
# Nico, 2019-01-23
90
[Peer]
91
PublicKey = kL1S/Ipq6NkFf1MAsNRou4b9VoUsnnb4ZxgiBrH0zA8=
92
AllowedIPs = 2a0a:e5c1:101::/48
93
94
# Customer networks below
95
# ...
96
</pre>
97
98
Sample server rc.local:
99
100
<pre>
101
ip link add dev wg0 type wireguard
102
ip addr add 2a0a:e5c1:100::1/40 dev wg0
103
wg setconf wg0 /etc/wireguard/wg0.conf
104
ip link set wg0 up
105
106 1 Nico Schottelius
</pre>
107
108
h2. OpenVPN on openvpn.ungleich.ch
109
110
* Server: openvpn.ungleich.ch
111
* Port: 1195
112
* Requires a certificate
113
* Address range: 2a0a:e5c0:3::/48
114
** Client networks are /64