Project

General

Profile

The ungleich VPN infrastructure » History » Version 5

Nico Schottelius, 01/23/2019 03:25 PM

1 1 Nico Schottelius
h1. The ungleich VPN infrastructure
2
3 5 Nico Schottelius
{{toc}}
4
5 1 Nico Schottelius
h2. Wireguard on vpn-2a0ae5c1.ungleich.ch
6
7
* Server: vpn-2a0ae5c1.ungleich.ch
8
* Port: 51820
9
* Requires a public key
10
* Client network: 
11
* Client network size: /48
12
13 2 Nico Schottelius
h3. Sample server configuration
14
15 3 Nico Schottelius
/etc/wireguard/wg0.conf:
16
17 2 Nico Schottelius
<pre>
18
[Interface]
19
ListenPort = 51820
20
PrivateKey = OEZPTrd6eh8rfh/jhZYyikboPT3fClRJjOjx4iA5NFg=
21
22
# Nico, 2019-01-23
23
[Peer]
24
PublicKey = kL1S/Ipq6NkFf1MAsNRou4b9VoUsnnb4ZxgiBrH0zA8=
25
AllowedIPs = 2a0a:e5c1:101::/48
26
27
# Customer networks below
28
# ...
29
</pre>
30
31
Sample server rc.local:
32
33
<pre>
34
ip link add dev wg0 type wireguard
35
ip addr add 2a0a:e5c1:100::1/40 dev wg0
36
wg setconf wg0 /etc/wireguard/wg0.conf
37
ip link set wg0 up
38
39
</pre>
40
41 1 Nico Schottelius
h3. Sample client configuration:
42
43 4 Nico Schottelius
/etc/wireguard/wg0.conf:
44
45 1 Nico Schottelius
<pre>
46
[Interface]
47
PrivateKey = YOURKEYHERE
48
ListenPort = 51280
49
50
[Peer]
51
PublicKey = 94WZhiEjyWnnymzA5OQcR34/IKkv1dgHf2JPsi5KzGU=
52
Endpoint = vpn-2a0ae5c1.ungleich.ch:51820
53
AllowedIPs = ::/0
54
</pre>
55 4 Nico Schottelius
56
Commands for setting it up
57
58
<pre>
59
MY_NET=2a0a:e5c1:XXXX::1/48
60
61
ip link add dev wg0 type wireguard
62
63
# Replace with your range
64
ip addr add $MY_NET dev wg0
65
66
# Add routing
67
ip route add 2a0a:e5c1:100::/40 dev wg0
68
ip route add ::/0 via 2a0a:e5c1:100::1
69
70
# Configure the interface
71
wg setconf wg0 /etc/wireguard/wg0.conf
72
73
# Bring it up
74
ip link set wg0 up
75
</pre>
76
77
Debugging
78
79
* wg show
80
* ping 2a0a:e5c1:100::1
81 1 Nico Schottelius
82
83
h2. OpenVPN on openvpn.ungleich.ch
84
85
* Server: openvpn.ungleich.ch
86
* Port: 1195
87
* Requires a certificate
88
* Address range: 2a0a:e5c0:3::/48
89
** Client networks are /64