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