Linux openvpn dns push

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 

Источник

OpenVPN не меняет DNS на клиенте

На клиенте (Ubuntu 18.04) УТЕЧКА DNS УСТРАНЕНА (DNS теперь не идёт через моего провайдера при конекте к VPN), но при подключении к серверу, DNS меняется не на OpenDNS (те, что в конфиге сервера), а на DNS провайдера сервера. При подключении с Android всё ок, https://www.dnsleaktest.com показывает сервера OpenDNS.

Читайте также:  Linux command ifconfig all

Могу приложить конфиги сервера и клиента.

Скажи спасибо systemd, который всё делает через жопу и сует свои поганые шупальца куда не просят, и иди его настраивать.

А поподробнее можно? Или ссылку

В твоей вселенной гугл не изобрели еще?
openvpn dns systemd

Читай новости украины. Гугла в России блокирует розкомнадзор. Недоступен, короче, гугл во вселенной России.

Не, пока вы тут его сравнивали с землей, мне было странно, но когда он отказывался запускать мой postges в режиме восстановления, я стал его недолюбливать.

Удалил openresolv, поставил openvpn-systemd-resolved. Сейчас в конце конфигурации записано следующее:

#dhcp-option DNS 208.67.222.222 #dhcp-option DNS 208.67.220.220 dhcp-option DOMAIN-ROUTE script-security 2 setenv PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin up /etc/openvpn/update-systemd-resolved down /etc/openvpn/update-systemd-resolved down-pre 

DNS leak test показывает моего провайдера. А если его закомментировать, а прописанные DNS раскомментировать, то показывает и DNS провайдера и OpenDNS одновременно. Но мне нужно чтобы DNS брался не из конфигурации клиента и шёл через провайдера, а брался из конфигурации сервера и через него же и шёл. Я надеюсь, смог донести суть, я не мастер объяснений. Если это важно: openvpn запускаю через

sudo openvpn --config client.ovpn

Источник

OpenVPN Support Forum

How to push Openvpn DNS with a client and debian on Freebox router

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.

How to push Openvpn DNS with a client and debian on Freebox router

Post by aka80 » Wed May 05, 2021 10:21 am

For two w,eeks, I have struggled with the configuration of Openvpn, installed on a debian VM, on my Freebox Delta.(router of my internet
provider)
I managed to put everything in place thanks to the YouTube tutorial accessible with the link below:

Everything worked perfectly, and the vpn is working. But I have a big DNS and IPV6 leak problem
To correct this, I tried pushing the google DNS from the vpn’s DNS server to the clients that will connect to it.

I have modified the «.client.conf file, with:
push «redirect-gateway def1 bypass-dhcp», with the prior installation of «openvpn-systemd-resolved»

push «dhcp-option DNS 8.8.8.8»
push «dhcp-option DNS 8.8.4.4»
script-security 2
up / etc / openvpn / update-systemd-resolved
down / etc / openvpn / update-systemd-resolved
down-pre
dhcp-option DOMAIN-ROUTE.

I also tried disabling IPV6 in /etc/sysctl.conf, but it doesn’t seem to work
the «Push DNS does not work either. impossible to have DNS swiped on clients

Читайте также:  Remove directory with file linux

On my pc it is this DNS fd0f: ee: b0 :: 1, ipv6 of my internet access provider, and the active IPv6, instead of the DNS of the VPN.
How do I get DNS Push to work, and be able to prevent DNS and IPv6 leaks?
thank you

Re: DNS leak with Openvpn and debian on Freebox router

Post by TinCanTech » Wed May 05, 2021 11:13 am

I have modified the «.client.conf file, with:
push «redirect-gateway def1 bypass-dhcp», with the prior installation of «openvpn-systemd-resolved»

push «dhcp-option DNS 8.8.8.8»
push «dhcp-option DNS 8.8.4.4»
script-security 2
up / etc / openvpn / update-systemd-resolved
down / etc / openvpn / update-systemd-resolved

You should start with the howto.

Re: DNS leak with Openvpn and debian on Freebox router

Post by aka80 » Wed May 05, 2021 11:47 am

I have modified the «.client.conf file, with:
push «redirect-gateway def1 bypass-dhcp», with the prior installation of «openvpn-systemd-resolved»

push «dhcp-option DNS 8.8.8.8»
push «dhcp-option DNS 8.8.4.4»
script-security 2
up / etc / openvpn / update-systemd-resolved
down / etc / openvpn / update-systemd-resolved

You should start with the howto.

Thank you for your answer

So from the client, i can’t use push?
How can I push openvpn dns to clients and avoid DNS and ipv6 leaks?

Re: How to push Openvpn DNS with a client and debian on Freebox router

Post by 300000 » Wed May 05, 2021 9:53 pm

on client you dont need push so just add this into your client it will work

«dhcp-option DNS 8.8.8.8»
«block-outside-dns»

block will make openvpn stop leak which you dont like . let add and try again . it is simple and should be done in 5 minutes.

Re: How to push Openvpn DNS with a client and debian on Freebox router

Post by aka80 » Thu May 06, 2021 6:26 am

on client you dont need push so just add this into your client it will work

«dhcp-option DNS 8.8.8.8»
«block-outside-dns»

block will make openvpn stop leak which you dont like . let add and try again . it is simple and should be done in 5 minutes.

Thank you for your answer.
Ok i use this with the lines «up / etc / openvpn / update-systemd-resolved
down / etc / openvpn / update-systemd-resolved» or not?

push «redirect-gateway def1 bypass-dhcp»
«dhcp-option DNS 8.8.8.8»
«dhcp-option DNS 8.8.4.4»
«block-outside-dns»
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf

Re: How to push Openvpn DNS with a client and debian on Freebox router

Post by 300000 » Thu May 06, 2021 6:59 am

Читайте также:  Get file name linux

Re: How to push Openvpn DNS with a client and debian on Freebox router

Post by aka80 » Thu May 06, 2021 7:55 am

i have added this on my client.ovpn :

push «redirect-gateway def1 bypass-dhcp»
«dhcp-option DNS 8.8.8.8»
«dhcp-option DNS 8.8.4.4»
«block-outside-dns»
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf

but when i do «openvpn pvpn.ovpn,, i have those messages:

Options error: Unrecognized option or missing or extra parameter(s) in client.ovpn:22: dhcp-option DNS 8.8.8.8 (2.4.7)
Use —help for more information.
root@VPN:/etc/openvpn# vim client.ovpn
root@VPN:/etc/openvpn# openvpn client.ovpn
Options error: Unrecognized option or missing or extra parameter(s) in client.ovpn:24: block-outside-dns (2.4.7)
Use —help for more information.
root@VPN:/etc/openvpn# vim client.ovpn
root@VPN:/etc/openvpn# openvpn client.ovpn
Options error: Unrecognized option or missing or extra parameter(s) in client.ovpn:24: block-outside-dns (2.4.7)
Use —help for more information.

Re: How to push Openvpn DNS with a client and debian on Freebox router

Post by aka80 » Thu May 06, 2021 8:29 am

i have added this on my client.ovpn :

push «redirect-gateway def1 bypass-dhcp»
«dhcp-option DNS 8.8.8.8»
«dhcp-option DNS 8.8.4.4»
«block-outside-dns»
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf

but when i do «openvpn pvpn.ovpn,, i have those messages:

Options error: Unrecognized option or missing or extra parameter(s) in client.ovpn:22: dhcp-option DNS 8.8.8.8 (2.4.7)
Use —help for more information.
root@VPN:/etc/openvpn# vim client.ovpn
root@VPN:/etc/openvpn# openvpn client.ovpn
Options error: Unrecognized option or missing or extra parameter(s) in client.ovpn:24: block-outside-dns (2.4.7)
Use —help for more information.
root@VPN:/etc/openvpn# vim client.ovpn
root@VPN:/etc/openvpn# openvpn client.ovpn
Options error: Unrecognized option or missing or extra parameter(s) in client.ovpn:24: block-outside-dns (2.4.7)
Use —help for more information.

ok i modified client.ovpn, addind to it:

systemd-resolve —status
push «redirect-gateway def1 bypass-dhcp»
dhcp-option DNS 8.8.8.8
dhcp-option DNS 8.8.4.4
push «block-outside-dns»
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
# Cert

i have no error and i have a Sequence Completed. Then i copied the file client.ovpn to client.conf
i reboot with «systemctl rebboot». The client start and the vpn work, but on my Macbook, i don’t have the Google DNS;
When i do «systemd-resolve —status», i have those infos:

Global
LLMNR setting: yes
MulticastDNS setting: yes
DNSOverTLS setting: no
DNSSEC setting: allow-downgrade
DNSSEC supported: yes
Current DNS Server: 8.8.8.8
DNS Servers: 8.8.8.8
8.8.4.4
10.35.53.1
DNSSEC NTA: 10.in-addr.arpa
16.172.in-addr.arpa
168.192.in-addr.arpa
17.172.in-addr.arpa
18.172.in-addr.arpa
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test
root@VPN:/etc/openvpn# vim client.ovpn

Источник

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