-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DNS routing with VPN #77
Comments
https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-debian-9 It talks about editing /etc/openvpn/server.conf but is this the right way to do it with lethean-vpn? My guess is that I can add some rules for ufw firewall in /etc/ufw/before.rules to make the DNS stuff work as I want. I am not very skilled how iptables and stuff works... Hmmm, a workaround could be making the DNS servers accessible from internet? Nah, it does not feel like the right way to do it and I want them dedicated for VPN users. It also opens up for the DNS man in the middle attacks I wanted to prevent by using DNS over TLS. It may also need client configuration. Reading the guide on the link above steps 8 - 10 it is possible to create client configuration files. Is there an option to transfer a client config from exit node to the VPN user? How does that work? |
Hi. Yes the redirect traffic is of course the key to the VPN. Then the push of DNS servers via DHCP options is also needed. But remember that you need to push an IP address of a DNS server that is routable from the VPN client. Anything 127/8 won’t be.
Vladimir Jirasek
Time zone: London/GMT
…________________________________
From: ronnylov <notifications@github.com>
Sent: Tuesday, March 26, 2019 09:34
To: LetheanMovement/lethean-vpn
Cc: Subscribed
Subject: Re: [LetheanMovement/lethean-vpn] DNS routing with VPN (#77)
https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-debian-9
In step 4 there is a header "(Optional) Push DNS Changes to Redirect All Traffic Through the VPN"
It talks about editing /etc/openvpn/server.conf but is this the right way to do it with lethean-vpn?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#77 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AEakPHSl2Wfqqaau03a6yxdDmEYGEsJxks5vaemhgaJpZM4cJd0A>.
|
Thanks Vlad! So add the route, add it in firewall and push DNS over dhcp. That's a plan! Need to figure out how to do it but getting closer now. My "FREEDOM" DNS server is at ip 172.28.0.11 (dedicated ip on a docker bridge network for DNS). Is that routable to VPN clients? I can push that ip address as DNS nameserver to the VPN clients on the "FREEDOM VPN"? When logged in to server via SSH I get response if I do "dig @172.28.0.11 google.com". |
Hi. This is actually about reachability by vpn Client’s. They would not know about your Dockers :)
Vladimir Jirasek
Time zone: London/GMT
…________________________________
From: ronnylov <notifications@github.com>
Sent: Tuesday, March 26, 2019 10:51
To: LetheanMovement/lethean-vpn
Cc: Vladimir Jirasek; Comment
Subject: Re: [LetheanMovement/lethean-vpn] DNS routing with VPN (#77)
Thanks Vlad!
I have the DNS servers in docker containers so I might route to them directly then. lethean-vpn is not in docker now but anyway. I found an example here:
https://serverfault.com/questions/802458/allow-docker-containers-to-connect-to-openvpn-clients-on-the-host-tunnel-interfa
So add the route, add it in firewall and push DNS over dhcp. That's a plan! Need to figure out how to do it but getting closer now.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#77 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AEakPMMwSU6SNJd1sWhWB9rmcFpaET-hks5vafu9gaJpZM4cJd0A>.
|
OK I have done following as first step to make OpenVPN clients able to make DNS requests to address 10.11.0.1 assuming OpenVPN clients get addresses in the range 10.11.0.0 - 10.11.255.255
Checking these rules gave me:
Next step would be port forwarding to make 10.11.0.1 do NAT to 172.28.0.11 and finally push 10.11.0.1 as DNS server on DHCP. Is this right way to do it? Thinking clients may have their own private network on 172.28.0.11 so better not cause confusion. |
I think this is too much complicated aproach. Just point clients to correct DNS server in your infra by parameter in dispatcher. Will make change to allow different DNS servers for different VPNs |
I have to learn standard routing. I need to push routes to clients to get them able to reach DNS on 172.28.0.11 on docker? I am using https://github.com/chaifeng/ufw-docker ti fix ufw and docker problems. Not sure if that change anything. Have to learn this stuff but it feels over my head right now... |
Routes are already pushed by default. You just need to make sure that firewall is configured well and they can reach these servers from their VPN networks. |
So I changed it to follwing using ufw firewall
And then I add this dns address to dispatcher.ini for this service. See if it will change anything. |
Should be running now but I can't test it. Is the DNS address pushed over DHCP to OpenVPN users? Lethernet FR VPN Test. |
It does not get my DNS-server address over VPN
However I can ping this address
|
Figured out how to do nslookup on Windows. Seems that the DNS server is accessible over VPN. So only problem is how to push it to DHCP server and then make sure client use it.
|
I need to see full debug log here.. Especially things about PUSH messages. |
I wonder if it should be "dhcp-option DNS 172.28.0.11" instead of "dhcp-option dns 172.28.0.11"? |
To prevent DNS leak: https://dnsleaktest.com/how-to-fix-a-dns-leak.html
|
Thank you, you probably found he issue! |
Just commited new branch bug/limosek/dnsrouting. Please test. |
Trying to figure out how to get localhost DNS server on exit node to be forwarded to OpenVPN clients with DHCP. Could be firewall rules or something but I can't get it to work. My wish is having one service using 127.0.0.1 nameserver, another one using 127.0.0.6 and the third one 127.0.0.8.
The text was updated successfully, but these errors were encountered: