-1

I have a problem with DNS settings in Ubuntu 16.04. First I configure my VPN connection using .ovpn file with command:

sudo openvpn vpn_config_file.ovpn

The interface tun0 is up but it's not getting any traffic:

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:192.168.200.66  P-t-P:192.168.200.65  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

I try to make a symlink symlink from /etc/resolv.conf to /run/resolvconf/resolv.conf but the problem is the same

The issue is that I'm not getting any traffic on the tun0 interface. At first sight, I thought it's a DNS issue. What could be the problem and how could I possibly fix this?

1 Answers1

2

Well, your description is very vague

A few things first you can check:

  • Make sure the OpenVPN server has the sysctl variable net.ipv4.ip_forward set to 1. You can easily check this using sysctl net.ipv4.ip_forward. In case you need to set it, just to sysctl -w net.ipv4.ip_forward=1 or the server's /etc/sysctl.conf
  • If you want to tunnel all your traffic over the vpn server, ensure you have set up your iptables rule corretly (in your case, probably iptables -t nat -A POSTROUTING -s 192.168.200.0/24 -j MASQUERADE
  • Make sure your DNS server is still reachable after connecting to the VPN or add something like push "dhcp-option DNS 8.8.8.8" to your server config.

If this does not help you, please provide some more details. Your overall description is very vague.
It was very helpful, if you posted your OpenVPN config in here (server + client) to enable us to help you better.