haugene / vpn-configs-contrib

A collection of configs for various VPN providers
GNU General Public License v3.0
180 stars 744 forks source link

curl: (6) Could not resolve host: tun0 #122

Closed alchemistake closed 9 months ago

alchemistake commented 2 years ago

Is there a pinned issue for this?

Is there an existing or similar issue/discussion for this?

Is there any comment in the documentation for this?

Is this related to a provider?

Are you using the latest release?

Have you tried using the dev branch latest?

Docker run config used

version: "3.3"
services:
    transmission-openvpn:
        cap_add:
            - NET_ADMIN
        volumes:
            - "/root/mam/data:/data"
            - "/root/books:/data/completed"
            - "/root/mam/config:/config"
            - "/root/mam/scripts:/scripts"
        environment:
            - OPENVPN_PROVIDER=PIA
            - OPENVPN_CONFIG=turkey
            - LOCAL_NETWORK=192.168.0.0/16
            - MAM_SESSION=$MAM_SESSION
            - OPENVPN_USERNAME=$OPENVPN_USERNAME
            - OPENVPN_PASSWORD=$OPENVPN_PASSWORD
            - TRANSMISSION_WEB_UI=flood-for-transmission
        logging:
            driver: json-file
            options:
                max-size: 10m
        image: haugene/transmission-openvpn
        restart: unless-stopped
        labels:
            - "traefik.enable=true"
            - "traefik.http.routers.mam.rule=Host(`mam.arceus.box`)"
            - "traefik.http.routers.mam.entrypoints=web"
            - "traefik.http.services.transmission-openvpn-mam.loadbalancer.server.port=9091"

Current Behavior

I'm getting error saying Could not resolve host: tun0

Expected Behavior

To be able to resolve tun0

How have you tried to solve the problem?

1) Tried updating local copy of the image 2) Tried DNS settings 3) Tried DNS Environment Variables

Log output

Starting OpenVPN using config turkey.ovpn
Modifying /etc/openvpn/pia/turkey.ovpn for best behaviour in this container
Modification: Point auth-user-pass option to the username/password file
Modification: Change ca certificate path
Modification: Change ping options
Modification: Update/set resolv-retry to 15 seconds
Modification: Change tls-crypt keyfile path
Modification: Set output verbosity to 3
Modification: Remap SIGUSR1 signal to SIGTERM, avoid OpenVPN restart loop
Setting OpenVPN credentials...
adding route to local network 192.168.0.0/16 via 172.21.0.1 dev eth0
Tue Jun 28 19:04:31 2022 OpenVPN 2.4.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Mar 22 2022
Tue Jun 28 19:04:31 2022 library versions: OpenSSL 1.1.1f  31 Mar 2020, LZO 2.10
Tue Jun 28 19:04:31 2022 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Tue Jun 28 19:04:31 2022 TCP/UDP: Preserving recently used remote address: [AF_INET]188.213.34.67:1198
Tue Jun 28 19:04:31 2022 Socket Buffers: R=[212992->212992] S=[212992->212992]
Tue Jun 28 19:04:31 2022 UDP link local: (not bound)
Tue Jun 28 19:04:31 2022 UDP link remote: [AF_INET]188.213.34.67:1198
Tue Jun 28 19:04:31 2022 TLS: Initial packet from [AF_INET]188.213.34.67:1198, sid=26cc2609 f7d32971
Tue Jun 28 19:04:31 2022 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Tue Jun 28 19:04:31 2022 VERIFY OK: depth=1, C=US, ST=CA, L=LosAngeles, O=Private Internet Access, OU=Private Internet Access, CN=Private Internet Access, name=Private Internet Access, emailAddress=secure@privateinternetaccess.com
Tue Jun 28 19:04:31 2022 VERIFY KU OK
Tue Jun 28 19:04:31 2022 Validating certificate extended key usage
Tue Jun 28 19:04:31 2022 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Tue Jun 28 19:04:31 2022 VERIFY EKU OK
Tue Jun 28 19:04:31 2022 VERIFY OK: depth=0, C=US, ST=CA, L=LosAngeles, O=Private Internet Access, OU=Private Internet Access, CN=istanbul401, name=istanbul401
Tue Jun 28 19:04:31 2022 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, 2048 bit RSA
Tue Jun 28 19:04:31 2022 [istanbul401] Peer Connection Initiated with [AF_INET]188.213.34.67:1198
Tue Jun 28 19:04:32 2022 SENT CONTROL [istanbul401]: 'PUSH_REQUEST' (status=1)
Tue Jun 28 19:04:32 2022 PUSH: Received control message: 'PUSH_REPLY,comp-lzo no,redirect-gateway def1,route-ipv6 2000::/3,dhcp-option DNS 10.0.0.243,route-gateway 10.1.112.1,topology subnet,ping 10,ping-restart 60,ifconfig 10.1.112.103 255.255.255.0,peer-id 12,cipher AES-128-GCM'
Tue Jun 28 19:04:32 2022 OPTIONS IMPORT: timers and/or timeouts modified
Tue Jun 28 19:04:32 2022 OPTIONS IMPORT: compression parms modified
Tue Jun 28 19:04:32 2022 OPTIONS IMPORT: --ifconfig/up options modified
Tue Jun 28 19:04:32 2022 OPTIONS IMPORT: route options modified
Tue Jun 28 19:04:32 2022 OPTIONS IMPORT: route-related options modified
Tue Jun 28 19:04:32 2022 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Tue Jun 28 19:04:32 2022 OPTIONS IMPORT: peer-id set
Tue Jun 28 19:04:32 2022 OPTIONS IMPORT: adjusting link_mtu to 1625
Tue Jun 28 19:04:32 2022 OPTIONS IMPORT: data channel crypto options modified
Tue Jun 28 19:04:32 2022 Data Channel: using negotiated cipher 'AES-128-GCM'
Tue Jun 28 19:04:32 2022 Outgoing Data Channel: Cipher 'AES-128-GCM' initialized with 128 bit key
Tue Jun 28 19:04:32 2022 Incoming Data Channel: Cipher 'AES-128-GCM' initialized with 128 bit key
Tue Jun 28 19:04:32 2022 ROUTE_GATEWAY 172.21.0.1/255.255.0.0 IFACE=eth0 HWADDR=02:42:ac:15:00:02
Tue Jun 28 19:04:32 2022 GDG6: remote_host_ipv6=n/a
Tue Jun 28 19:04:32 2022 ROUTE6: default_gateway=UNDEF
Tue Jun 28 19:04:32 2022 OpenVPN ROUTE6: OpenVPN needs a gateway parameter for a --route-ipv6 option and no default was specified by either --route-ipv6-gateway or --ifconfig-ipv6 options
Tue Jun 28 19:04:32 2022 OpenVPN ROUTE: failed to parse/resolve route for host/network: 2000::/3
Tue Jun 28 19:04:32 2022 TUN/TAP device tun0 opened
Tue Jun 28 19:04:32 2022 TUN/TAP TX queue length set to 100
Tue Jun 28 19:04:32 2022 /sbin/ip link set dev tun0 up mtu 1500
Tue Jun 28 19:04:32 2022 /sbin/ip addr add dev tun0 10.1.112.103/24 broadcast 10.1.112.255
Tue Jun 28 19:04:32 2022 /etc/openvpn/tunnelUp.sh tun0 1500 1553 10.1.112.103 255.255.255.0 init
Up script executed with tun0 1500 1553 10.1.112.103 255.255.255.0 init
Updating TRANSMISSION_BIND_ADDRESS_IPV4 to the ip of tun0 : 10.1.112.103
Using Flood for Transmission UI, overriding TRANSMISSION_WEB_HOME
Updating Transmission settings.json with values from env variables
Using existing settings.json for Transmission /data/transmission-home/settings.json
Overriding bind-address-ipv4 because TRANSMISSION_BIND_ADDRESS_IPV4 is set to 10.1.112.103
Overriding download-dir because TRANSMISSION_DOWNLOAD_DIR is set to /data/completed
Overriding incomplete-dir because TRANSMISSION_INCOMPLETE_DIR is set to /data/incomplete
Overriding rpc-port because TRANSMISSION_RPC_PORT is set to 9091
Overriding watch-dir because TRANSMISSION_WATCH_DIR is set to /data/watch
sed'ing True to true

-------------------------------------
Transmission will run as
-------------------------------------
User name:   root
User uid:    0
User gid:    0
-------------------------------------

STARTING TRANSMISSION
Provider PIA has a script for automatic port forwarding. Will run it now.
If you want to disable this, set environment variable DISABLE_PORT_UPDATER=true
Executing /scripts/transmission-post-start.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
Running functions for token based port fowarding

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:04 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:05 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:06 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:07 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:08 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:09 --:--:--     0curl: (6) Could not resolve host: t.myanonamouse.net
/scripts/transmission-post-start.sh returned 6
Transmission startup script complete.
Tue Jun 28 19:04:42 2022 /sbin/ip route add 188.213.34.67/32 via 172.21.0.1
Tue Jun 28 19:04:42 2022 /sbin/ip route add 0.0.0.0/1 via 10.1.112.1
Tue Jun 28 19:04:42 2022 /sbin/ip route add 128.0.0.0/1 via 10.1.112.1
Tue Jun 28 19:04:42 2022 WARNING: OpenVPN was configured to add an IPv6 route over tun0. However, no IPv6 has been configured for this interface, therefore the route installation may fail or may not work as expected.
Tue Jun 28 19:04:42 2022 Initialization Sequence Completed
curl: (6) Could not resolve host: www.privateinternetaccess.com
curl: (6) Could not resolve host: tun0
curl: (6) Could not resolve host: tun0
curl: (6) Could not resolve host: tun0
curl: (6) Could not resolve host: tun0
curl: (6) Could not resolve host: tun0
curl: (6) Could not resolve host: tun0
Tue Jun 28 19:06:03 UTC 2022: getSignature error

the has been a fatal_error
curl: (6) Could not resolve host: tun0
curl: (6) Could not resolve host: tun0
curl: (6) Could not resolve host: tun0

HW/SW Environment

- OS: Alpine 3.15
- Docker: 20.10.16
- Kernel: Kernel 5.15.40-0-virt
- Arche: x86_64

Anything else?

It was working before I moved houses and now it is having problems with tun0

pkishino commented 2 years ago

This is an issue with PIA and the script.. please try us dev branch for now.. master is quite old

mhbates commented 2 years ago

I had the same issue and it was happening with dev image as well. PIA provider as well. Couldn't resolve host in this instance (myanonamouse via startup script), and also couldn't resolve host when trying the script for image v4.0 that upgrades Transmission to 3.0 during startup.