This tutorial has been written by [TheFrenchGhosty](https://github.com/TheFrenchGhosty). He is better suited when looking for help about this tutorial.
Note: We're not using the Gluetun default of 172.18.0.0/16, because it might already be used which causes Gluetun to not start with the error `Error response from daemon: invalid pool request: Pool overlaps with other one on this address space`, if you have this issue with 172.80.0.0/16 just use a number higher than "80" (at the second byte) and apply the rest of the documentation accordingly
## Create the compose file for Gluetun
- Global setup: https://github.com/qdm12/gluetun-wiki/tree/main/setup
## Tell Gluetun to change IP daily (optional but recommended)
**Don't forget to replace `/path/to/` with a proper path**
- Control server documentation https://github.com/qdm12/gluetun-wiki/blob/main/setup/advanced/control-server.md
Start by exposing the Gluetun control server internally (DO NOT EXPOSE IT EXTERNALLY, KEEP `127.0.0.1`), add this port mapping to Gluetun:
```
ports:
- 127.0.0.1:8000:8000/tcp # Control server
```
Write a script named `restartvpn.sh` and add this content to it:
! Remember to replace /path/to/ with the path you want the log to go (either the script location, or `/var/log/`) !
Note: `2>&1` sent STDERR to STDOUT, `tee /path/to/restartvpn.log` will write the output of the script to /path/to/restartvpn.log (in the current directory) (while still printing it to the shell)
curl -s -X PUT -H "Content-Type: application/json" -d '{"status":"running"}' "http://127.0.0.1:8000/v1/openvpn/status" 2>&1 | tee -a /path/to/restartvpn.log # Start OpenVPN (changing the server it's connecting to)