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