edgd1er / nordvpn-proxy

NordVPN openVPN socks
26 stars 8 forks source link

route: ioctl 0x890b failed: File exists #14

Closed alpe12 closed 2 years ago

alpe12 commented 2 years ago

route add default dev eth0 is failing with this error.

This is the output of the route command inside the container.

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         *               0.0.0.0         U     0      0        0 eth0

default         192.168.16.1    0.0.0.0         UG    0      0        0 eth0
192.168.16.0    *               255.255.240.0   U     0      0        0 eth0

If this is the way it's supposed to look like at this point of the script execution, make it ignore "route: ioctl 0x890b failed: File exists" errors and continue.

Replacing route add default dev eth0 with ip route replace default dev eth0 might be a solution.

Edit: It failing is possibly a symptom, not the cause of the issue. So using 'replace' is probably only a partial fix.

Thanks again.

PS: after restarting the service many times it eventually work. very weird since I always use docker-compose down to start clean. PPS: I'm still debugging to find out why this happens.

nordvpn-proxy     | INFO: OVPN: DNS resolution ok
nordvpn-proxy     | INFO: OVPN: ok, configurations download site reachable
nordvpn-proxy     | INFO: OVPN: Removing existing configs in /etc/service/openvpn/nordvpn
nordvpn-proxy     | INFO: ########################################################
nordvpn-proxy     | INFO: openvpn: stopping
nordvpn-proxy     | INFO: openvpn: stopped
nordvpn-proxy     | INFO: OVPN: Checking curl installation
nordvpn-proxy     | INFO: ########################################################
nordvpn-proxy     | INFO: openvpn: stopping
nordvpn-proxy     | route: ioctl 0x890b failed: File exists
nordvpn-proxy     | INFO: OVPN: Checking curl installation
nordvpn-proxy     | INFO: ########################################################
nordvpn-proxy     | INFO: openvpn: stopping
nordvpn-proxy     | route: ioctl 0x890b failed: File exists
nordvpn-proxy     | INFO: OVPN: Checking curl installation

Sometimes I also get:

nordvpn-proxy     | INFO: OVPN: DNS resolution ok
nordvpn-proxy     | ping: bad address 'downloads.nordcdn.com'
edgd1er commented 2 years ago

The route add default is in the down process of openvpn after having stopped all others services, to avoid leaks, in order to re establish a lost connection to vpn servers. I've not fully tested this feature as previously, every time the connection was lost, all the container was stopped.

As you said, the error is just a symptom of an uncompleted vpn connection. When the connection is established with vpn server, openvpn calls the up.sh script wich drop default route. So later, re enabling that route should be ok.

#when vpn is up, delete default route going through eth0
route del default eth0

The setup process check dns resolution and perform a ping. Here the dig +short downloads.nordcdn.com command returned a result not null, but performing a ping on that resolved address failed.

I'm afraid you have a dns issue or network issue.

edgd1er commented 2 years ago

Should be this issue still active please le me know.