Ungleich IPv6 wireguard VPN » History » Version 1
Timothée Floure, 01/08/2020 06:16 PM
Import user documentation from "The ungleich IPv6 VPN infrastructure"
1 | 1 | Timothée Floure | h1. Ungleich IPv6 wireguard VPN |
---|---|---|---|
2 | |||
3 | {{toc}} |
||
4 | |||
5 | *%{color:red}This document only concerns VPN clients and is intended for end-users/customers. See [[The ungleich VPN infrastructure]] page for server-side documentation.%* |
||
6 | |||
7 | h2. Status |
||
8 | |||
9 | This document is *IN PRODUCTION*. |
||
10 | |||
11 | h2. How to get VPN |
||
12 | |||
13 | * If you are a VM users of DataCenterLight, you get it for free |
||
14 | * Otherwise you can book it at https://IPv6VPN.ch |
||
15 | * In both cases, send a request to support at ungleich.ch |
||
16 | |||
17 | Technically, the following steps are necessary: |
||
18 | |||
19 | <pre> |
||
20 | 1. Install Wireguard |
||
21 | https://www.wireguard.com/install/ |
||
22 | |||
23 | 2. Create your private key: |
||
24 | umask 077; wg genkey > privkey |
||
25 | |||
26 | 3. Get your public key |
||
27 | wg pubkey < privkey |
||
28 | |||
29 | 4. Send us the pubkey |
||
30 | </pre> |
||
31 | |||
32 | If you want to be fast, you can already take these steps before contacting support. |
||
33 | |||
34 | |||
35 | h2. Security of IPv6 vs. NAT |
||
36 | |||
37 | A quick reminder: whether you are using private RFC1918 IPv4 addresses or IPv6 addresses, if you don't want people to access your network, you need to configure a firewall. |
||
38 | |||
39 | h2. Wireguard VPN on vpn-2a0ae5c1.ungleich.ch |
||
40 | |||
41 | * Server: vpn-2a0ae5c1.ungleich.ch |
||
42 | * Port: 51820 |
||
43 | * Requires a public key |
||
44 | * Client network: 2a0a:e5c1:100::/40 |
||
45 | * Client network size: /48 |
||
46 | |||
47 | h3. Sample clustomer client configuration |
||
48 | |||
49 | * "Install wireguard":https://www.wireguard.com/install/ |
||
50 | * Create your private key: @umask 077; wg genkey > privkey@ |
||
51 | * Get your public key: @wg pubkey < privkey@ |
||
52 | ** You need to send this pubkey to ungleich |
||
53 | * You will get your network definition after we have received your public key |
||
54 | * Create /etc/wireguard/wg0.conf |
||
55 | |||
56 | <pre> |
||
57 | [Interface] |
||
58 | PrivateKey = YOURKEYHERE |
||
59 | Address = YOURIPv6IPADDRESSHERE/48 |
||
60 | ListenPort = 51280 |
||
61 | |||
62 | [Peer] |
||
63 | PublicKey = hi60lGP+xEUQ+kVnqA7PlJAO1SVqTS1W36g0LhFP0xQ= |
||
64 | Endpoint = vpn-2a0ae5c1.ungleich.ch:51820 |
||
65 | AllowedIPs = ::/0 |
||
66 | </pre> |
||
67 | |||
68 | * *ONLY change* the PrivateKey and the Address entries. |
||
69 | * *ALL other entries* (especially PublicKey, Endpoint and AllowedIPs) need to *stay as is* |
||
70 | |||
71 | h3. How to setup the VPN (the easy way) |
||
72 | |||
73 | Once you have created the configuration, you can simply call |
||
74 | |||
75 | <pre> |
||
76 | wg-quick up wg0 |
||
77 | </pre> |
||
78 | |||
79 | And to stop the VPN, you can use |
||
80 | |||
81 | <pre> |
||
82 | wg-quick down wg0 |
||
83 | </pre> |
||
84 | |||
85 | |||
86 | h3. How to setup the VPN (the manual way) |
||
87 | |||
88 | |||
89 | Commands for setting it up |
||
90 | |||
91 | <pre> |
||
92 | MY_NET=2a0a:e5c1:XXXX::1/48 |
||
93 | |||
94 | ip link add dev wg0 type wireguard |
||
95 | |||
96 | # Replace with your range |
||
97 | ip addr add $MY_NET dev wg0 |
||
98 | |||
99 | # Add routing |
||
100 | ip route add 2a0a:e5c1::/32 dev wg0 |
||
101 | ip route add ::/0 via 2a0a:e5c1:100::1 |
||
102 | |||
103 | # Configure the interface |
||
104 | wg setconf wg0 /etc/wireguard/wg0.conf |
||
105 | |||
106 | # Bring it up |
||
107 | ip link set wg0 up |
||
108 | </pre> |
||
109 | |||
110 | h3. About usable IPv6 addresses |
||
111 | |||
112 | We route a /48 to everyone. Even though technically possible, you should not use the *zero address* of your network, as it is reserved for reaching all routers. |
||
113 | I.e. if your IPv6 network was 2a0a:e5c1:101::/48, don't use 2a0a:e5c1:101::. The reason for this is that all routers (devices that have ip forwarding enabled) for this network |
||
114 | are supposed to answer on this address. |
||
115 | |||
116 | In other words, in your wg0.conf use: |
||
117 | |||
118 | <pre> |
||
119 | [Interface] |
||
120 | ... |
||
121 | Address = 2a0a:e5c1:101::42/48 |
||
122 | </pre> |
||
123 | |||
124 | Do *NOT* use: |
||
125 | |||
126 | <pre> |
||
127 | [Interface] |
||
128 | ... |
||
129 | # Don't use this |
||
130 | Address = 2a0a:e5c1:101::/48 |
||
131 | </pre> |
||
132 | |||
133 | |||
134 | h3. How to debug |
||
135 | |||
136 | * wg show # Show configuration |
||
137 | * ping 2a0a:e5c1:100::1 # Try to ping the gateway |
||
138 | |||
139 | If you want to send us your configuration, you should remove your private key from wg0.conf. |
||
140 | Under Linux/BSD/MacOS you can do that as follows: |
||
141 | |||
142 | <pre> |
||
143 | cat /etc/wireguard/wg0.conf | sed 's/\(PrivateKey =\).*/\1 MYPRIVATEKEY/' |
||
144 | </pre> |
||
145 | |||
146 | The result could look as follows: |
||
147 | |||
148 | <pre> |
||
149 | root@line:~# cat /etc/wireguard/wg0.conf | sed 's/\(PrivateKey =\).*/\1 MYPRIVATEKEY/' |
||
150 | [Interface] |
||
151 | PrivateKey = MYPRIVATEKEY |
||
152 | ListenPort = 51280 |
||
153 | Address = 2a0a:e5c1:101::42/48 |
||
154 | #DNS = 2a0a:e5c0::3, 2a0a:e5c0::4 |
||
155 | |||
156 | [Peer] |
||
157 | PublicKey = hi60lGP+xEUQ+kVnqA7PlJAO1SVqTS1W36g0LhFP0xQ= |
||
158 | Endpoint = vpn-2a0ae5c1.ungleich.ch:51820 |
||
159 | AllowedIPs = ::/0 |
||
160 | </pre> |
||
161 | |||
162 | h3. How to config wireguard on mobile phone(android / ios) |
||
163 | |||
164 | <pre> |
||
165 | You should fill out DNS field. |
||
166 | ex) for ipv6 DNS ==> 2a0a:e5c0::3 or 2a0a:e5c0::4 |
||
167 | and you should assgin phone own IP. |
||
168 | ex) laptop Address = 2a0a:e5c1:101::42/48 |
||
169 | phone Address = 2a0a:e5c1:101::43/48 |
||
170 | another things are same as client's configutaion. |
||
171 | </pre> |
||
172 | |||
173 | h3. How to config IPv6 DNS on wireguard(if it can't find DNS) |
||
174 | |||
175 | <pre> |
||
176 | You should fill out DNS field. |
||
177 | ex) for ipv6 DNS ==> 2a0a:e5c0::3 or 2a0a:e5c0::4 |
||
178 | DNS = 2a0a:e5c0::3 |
||
179 | </pre> |
||
180 | |||
181 | h3. How to config wireguard manually on Mac OS without APP(for using IPv4 and IPv6 at the same time) |
||
182 | |||
183 | <pre> |
||
184 | 1) install wireguard on macOS |
||
185 | - brew install wireguard-tools |
||
186 | |||
187 | 2)find wireguard install location |
||
188 | - cd /usr/local/etc/wireguard |
||
189 | |||
190 | 3) create wg0.conf in wireguard location(refer to above) |
||
191 | |||
192 | 4) run wireguard |
||
193 | - wg-quick up wg0 |
||
194 | </pre> |
||
195 | |||
196 | h2. OpenVPN on openvpn.ungleich.ch |
||
197 | |||
198 | * Server: openvpn.ungleich.ch |
||
199 | * Port: 1195 |
||
200 | * Requires a certificate |
||
201 | * Address range: 2a0a:e5c0:3::/48 |
||
202 | ** Client networks are /64 |
||
203 | |||
204 | *END OF LIFE by 2019-06-30* |