Commit c07fbadb authored by Nicolas Lenz's avatar Nicolas Lenz

sudo instead of #

parent 3cf9159f
......@@ -80,7 +80,7 @@ Gateway = {The address of the interface, same as above}
Table = 242
```
Then run `# docker network create tunneled0 --subnet 10.123.0.0`. Now you can run docker containers with `--net=tunneled0` to tunnel them.
Then run `sudo docker network create tunneled0 --subnet 10.123.0.0`. Now you can run docker containers with `--net=tunneled0` to tunnel them.
Alternatively use Docker Compose to create and use a Docker network in that subnet:
......@@ -113,7 +113,7 @@ Make sure that your host has:
- The WireGuard tools installed.
- Docker and optionally Docker Compose installed.
- A working network connection. I don't think it needs to be configured using systemd-networkd, though I haven't tested that. I recommend to use networkd if possible anyway.
- systemd-networkd running and enabled (`# systemctl enable systemd-networkd && systemctl start system-networkd`).
- systemd-networkd running and enabled (`sudo systemctl enable systemd-networkd && systemctl start system-networkd`).
## Setting up the Interface
......@@ -157,10 +157,10 @@ Use `# systemctl restart systemd-networkd` (or reboot to be sure) to apply the c
```
$ curl -4 icanhazip.com
# curl -4 --interface wg0 icanhazip.com
$ sudo curl -4 --interface wg0 icanhazip.com
```
The results of the two `curl` calls should be different, the first shows your normal IP, the second one should yield the VPN IP address. Note that for me the second curl only works as root (probably curl can only bind to the interface as root for some reason). With `# wg` and `$ networkctl status wg0` you can get further info about the interface.
The results of the two `curl` calls should be different, the first shows your normal IP, the second one should yield the VPN IP address. Note that for me the second curl only works as root (probably curl can only bind to the interface as root for some reason). With `sudo wg` and `networkctl status wg0` you can get further info about the interface.
## Routing
......@@ -199,9 +199,9 @@ Note for both methods that published ports will not be available on `localhost`
### Docker Directly
Create a Docker network in the subnet we used in the systemd-networkd config file with `# docker network create tunneled0 --subnet 10.123.0.0` (or use any other name than `tunneled0`), then run containers in that network by using the `--net=tunneled0` option. With the `--dns` option you can set a custom DNS so that no DNS traffic gets leaked.
Create a Docker network in the subnet we used in the systemd-networkd config file with `sudo docker network create tunneled0 --subnet 10.123.0.0` (or use any other name than `tunneled0`), then run containers in that network by using the `--net=tunneled0` option. With the `--dns` option you can set a custom DNS so that no DNS traffic gets leaked.
For example, you can use `# docker run -t --net=tunneled0 curlimages/curl icanhazip.com` to check that the returned IP is actually the VPN's IP.
For example, you can use `sudo docker run -t --net=tunneled0 curlimages/curl icanhazip.com` to check that the returned IP is actually the VPN's IP.
### Docker Compose
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment