Created FAQ (WireGuard) (markdown)

Orazio 2020-02-01 09:47:30 +01:00
parent d3eede57e9
commit 85d56322f9

66
FAQ-(WireGuard).md Normal file

@ -0,0 +1,66 @@
# FAQ (Frequently Asked Questions)
## How do I use Pi-hole with PiVPN?
You can safely install PiVPN on the same Raspberry Pi as your Pi-hole install, and point your VPN clients to the IP of your Pi-hole so they get ad blocking, etc. Note that if you install PiVPN after Pi-hole, your existing Pi-hole installation will be detected and the script will ask if you want to use is as the DNS for the VPN, so you won't need to go through all these steps.
1. Create a new file `sudo nano /etc/dnsmasq.d/02-pivpn.conf`
2. Add `interface=wg0` inside to tell Pi-hole to listen on the VPN interface as well
3. Save the file end exit
4. Restart Pi-hole with `pihole restartdns`
5. Edit the PiVPN configuration with `sudo nano /etc/pivpn/setupVars.conf`
6. Remove the `pivpnDNS1=[...]` and `pivpnDNS2=[...]` lines
7. Add this line `pivpnDNS1=10.6.0.1` to point clients to the PiVPN IP
8. Save the file and exit
New clients you generate will use Pi-hole but you need to manually edit existing clients:
1. Open your configuration, for example whatever.conf
2. Replace the line `DNS = [...], [...]` with this line `DNS = 10.6.0.1`
4. Save the file and connect again
## How do I change the public IP/DNS name of the PiVPN?
1. Edit the PiVPN configuration with `sudo nano /etc/pivpn/setupVars.conf`
2. Update the `pivpnHOST=[...]` line
3. Save and exit
New clients you generate will use the new endpoint but you need to manually edit existing clients:
1. Open your configuration, for example whatever.conf
2. Update the line `Endpoint = [...]:51820`
3. Save the file and connect again
## How do I allow clients access to my home network but not the internet through my PiVPN?
Replace the following line in your client configuration: `AllowedIPs = 0.0.0.0/0` with `AllowedIPs = [...]` where `[...]` is the IP and netmask of your LAN, for example `192.168.23.0/24`.
## How Can I Migrate my configs to another PiVPN Instance?
Backup your server with `pivpn -bk`
copy the tar archive to your computer.
example using scp on linux:
`scp <user>@<server>:~/pivpnbackup/<archivename> <path/on/local>`
**Install WireGuard the new pi/server**
1. Backup the current install:`sudo cp -r /etc/wireguard /etc/wireguard_backup`
2. Extract the backup archive: `tar xzpfv <archive name>`
3. Copy the extracted content: `sudo cp -r etc/wireguard /etc/wireguard`
4. Restart openvpn or wireguard service: `sudo systemcl restart wg-quick@wg0`
**OBS:** Please be aware of the difference between `/etc/` and `etc/`!
/etc with the starting slash is a system directory
etc/ without starting slash and tailing slash means its a directory in your current working dir.
## How to resolve local hostnames?
to resolve local hostnames all you have to do is to use your router as DNS Server instead of using other public DNS providers.
If you have already a working installation of WireGuard, all you need to do is to edit your client config and change the line `DNS = [...], [...]` to `DNS = 192.168.23.1` (assuming 192.168.23.1 is your gateway IP).
Alternatively you can change `/etc/hosts` file and add `<IPAddress> <hostname>`
Example:
```
192.168.1.1 JohnDoeRouter
192.168.1.2 JohnDoePC
192.168.1.3 JaneDoePC
192.168.1.4 CatPC
192.168.1.5 DogPC
```