Linux vpn no dns

Ubuntu 18.04 no DNS resolution when connected to OpenVPN

When I connect to a VPN network through Gnome Network-manager I lose DNS resolution and in practice, I cannot access resources inside the VPN network or outside. When I was using Ubuntu 16.04 and I was using the VPN, the » /etc/resolv.conf/ » file would contain the DNS servers of the (VPN) network I had connected. Now it always contains the following entries:

nameserver 127.0.0.53 search myprovider.com 

From what I have understood 127.0.0.53 is the address of the DNS stub used by the system-resolved . I suspect that this is a bug because the VPN was working fine the Ubuntu 16.04. Is there any way that I can set the DNS servers of my network when I am using a VPN service? Update: I tried connecting to the OpenVPN network with the configuration file attached at the end of the post, but I get the following error:

 Authenticate/Decrypt packet error: cipher final failed 

I have verified that the server uses lzo compression and I have enabled it as well. The connection stays active but I cannot navigate to any page inside or outside the VPN. In the configuration file listed below, I have included the solutions posted in the replies

 client dev tun proto udp remote openvpn.bibsys.no 1194 remote my-server-2 1194 resolv-retry infinite nobind user myuser group myuser persist-key persist-tun ca ca-cert.pem cert openvpn.crt key openvpn.key cipher AES-256-CBC comp-lzo yes script-security 2 up /etc/openvpn/scripts/update-systemd-resolved down /etc/openvpn/scripts/update-systemd-resolved down-pre 

Источник

Читайте также:  Linux посмотреть скорость линка

Thread: NO DNS after connecting to OpenVPN ubuntu 16.10

amrasurion is offline5 Cups of Ubuntu

Thumbs upNO DNS after connecting to OpenVPN ubuntu 16.10

QuoteOriginally Posted by SeijiSensei View Post

to the bottom of that file. Then restart resolvconf or reboot. Any better? If so, and you prefer to use OpenDNS, replace 8.8.8.8 with the appropriate OpenDNS server address.

Added cert and key file to network manager and was able to connect but no pages would load and wasnt able to ping. I can connect via windows 10 no problem.

Had to physically disconnect vpn from network manager. The only way i was able to connect, get IP to change and pages to load was select the .ovpn file

sudo openvpn ~/ovpnfiles/client1.ovpn

this also stopped working after checking ipleak and a couple other pages. and the only way for me to access the internet again was to
sudo ifconfig tun0
down and now I’m here to see what my options are. I’ll be checking here frequently to see what some of your ideas may be.

now when run the .ovpn i cannot load anything and i dont understand why it would work before but not now.

edit : i edited the VPN connection and changed DNS to opendns servers. Now im currently connected as i type this ipleak.net shows the dns is correct but ip remains the same.

edit :i removed the VPNs certs from edit connections and added them back in. The following reconnect was successfull and IP change but by the next page load it had stalled

Источник

Problem with DNS with OpenVPN on Ubuntu 20.04

I have installed the OpenVPN server and the Bind9 DNS server on the company server. The part of the server config is below. The important part is a pushing route and DHCP DNS option.

local 10.0.9.2 port 1194 proto udp dev tun topology subnet server 10.0.12.0 255.255.255.0 ifconfig-pool-persist ipp.txt push "route 10.0.9.0 255.255.255.0" push "dhcp-option DNS 10.0.9.2" 

When connecting on Windows or Elementary OS, everything works great. Only traffic to the server is going through the VPN, the rest does not. If the client is forcing to pass all traffic through the VPN, the internet access works too. In both cases, when trying to access git.internal.mycompany.org it gets DNS records from my Bind9 DNS server and connects correctly. But this does not work in Ubuntu. When passing whole traffic through VPN, a record from DNS is taken. But when only server traffic goes through VPN, then DNS is not reached and I cannot access the git server via URL. When reaching via IP, it works. I tried also to add to the client config this.

script-security 2 up /etc/openvpn/update-systemd-resolved down /etc/openvpn/update-systemd-resolved 

But this does not help. Maybe because when I try to run the script directly, I got an error /etc/openvpn/update-systemd-resolved: řádek 404: dev: unbound variable . I don’t know how to fix this. I tried to search here on AskUbuntu and others, but most suggest adding up and down to the config. Which does not work for me. It is a problem because most of my colleagues are using Ubuntu. Only few computers are using Windows or other Linux distro.

Читайте также:  Apache файловый сервер linux

Update with applied changes

  • When I added redirect-gateway def1 bypass-dhcp into config, then my public IP is IP of the server, but still cannot ping URL above.
  • When imported config into the UI of Ubuntu as mentioned https://askubuntu.com/a/1188022/972420, ping works until I uncheck Use this connection only for traffic within this network .

Источник

Оцените статью
Adblock
detector