Tun device is created inside the container, fixes #2
This commit is contained in:
11
README.md
11
README.md
@@ -46,14 +46,6 @@ Cloudflare **DNS 1.1.1.1 over TLS** is used to connect to any PIA server for mul
|
|||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
1. Run the [**tun.sh**](https://raw.githubusercontent.com/qdm12/private-internet-access-docker/master/tun.sh) script on your host machine to ensure you have the `/dev/tun` device setup
|
|
||||||
|
|
||||||
```bash
|
|
||||||
wget https://raw.githubusercontent.com/qdm12/private-internet-access-docker/master/tun.sh
|
|
||||||
sudo chmod +x tun.sh
|
|
||||||
./tun.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
1. Create a network to be used by this container and other containers connecting to it with:
|
1. Create a network to be used by this container and other containers connecting to it with:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -70,8 +62,7 @@ Cloudflare **DNS 1.1.1.1 over TLS** is used to connect to any PIA server for mul
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -d --restart=always --name=pia --cap-add=NET_ADMIN \
|
docker run -d --restart=always --name=pia --cap-add=NET_ADMIN \
|
||||||
--device=/dev/net/tun --network=pianet \
|
--network=pianet -v /yourhostpath/auth.conf:/auth.conf:ro \
|
||||||
-v /yourhostpath/auth.conf:/auth.conf:ro \
|
|
||||||
-e REGION=Germany -e PROTOCOL=udp -e ENCRYPTION=normal \
|
-e REGION=Germany -e PROTOCOL=udp -e ENCRYPTION=normal \
|
||||||
qmcgaw/private-internet-access
|
qmcgaw/private-internet-access
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ echo "nameserver 127.0.0.1" > /etc/resolv.conf
|
|||||||
echo "options ndots:0" >> /etc/resolv.conf
|
echo "options ndots:0" >> /etc/resolv.conf
|
||||||
printf "DONE\nStarting Unbound to connect to Cloudflare DNS 1.1.1.1 at its TLS endpoint..."
|
printf "DONE\nStarting Unbound to connect to Cloudflare DNS 1.1.1.1 at its TLS endpoint..."
|
||||||
unbound
|
unbound
|
||||||
|
printf "DONE\nCreating TUN device..."
|
||||||
|
mkdir -p /dev/net
|
||||||
|
mknod /dev/net/tun c 10 200
|
||||||
|
chmod 600 /dev/net/tun
|
||||||
printf "DONE\nStarting OpenVPN using $PROTOCOL with $ENCRYPTION encryption\n"
|
printf "DONE\nStarting OpenVPN using $PROTOCOL with $ENCRYPTION encryption\n"
|
||||||
cd /openvpn-$PROTOCOL-$ENCRYPTION
|
cd /openvpn-$PROTOCOL-$ENCRYPTION
|
||||||
openvpn --config "$REGION.ovpn" --auth-user-pass /auth.conf
|
openvpn --config "$REGION.ovpn" --auth-user-pass /auth.conf
|
||||||
|
|||||||
Reference in New Issue
Block a user