I am using Ubuntu Server 18.04.1 LTS (Bionic Beaver). I run OpenVPN with redirect-gateway disabled because I don't want traffic to use it by default, only one specific application. This is the command i use:

sudo openvpn --config /etc/openvpn/CA\ Montreal.ovpn --pull-filter ignore redirect-gateway --daemon

And then if I use the following command:

curl http://ipinfo.io/ip --interface tun0

I get my real external IP address, not my VPN address. But if I run the command:

sudo curl http://ipinfo.io/ip --interface tun0

I then get my VPN IP address. I am experiencing this issue in other programs too, such as traceroute.

$ traceroute -i tun0
traceroute to (, 30 hops max, 60 byte packets
setsockopt SO_BINDTODEVICE: Operation not permitted
$ sudo traceroute -i tun0
traceroute to (, 30 hops max, 60 byte packets
 1 (  73.600 ms  74.061 ms  74.045 ms
 2 (  74.041 ms (  74.193 ms (  73.995 ms
 3 (  73.991 ms  74.143 ms (  74.021 ms
 4  ae7-67.cr0-mtl1.ip4.gtt.net (  74.065 ms ae7-103.cr0-mtl1.ip4.gtt.net (  74.113 ms  74.162 ms
 5  cloudflare-gw.cr0-mtl1.ip4.gtt.net (  74.210 ms  74.157 ms  74.384 ms
 6  one.one.one.one (  74.052 ms  73.802 ms  73.843 ms

How do I fix it so a program doesn't need root to go through the VPN?

  • Well...I just rebooted the server and now curl and traceroute don't work at all. As either a user or root. – Jack Cole Nov 24 '18 at 9:59

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.