You are not logged in.

#1 2017-06-18 12:26:39

thepasto
Member
From: trash:///
Registered: 2009-03-16
Posts: 56

[SOLVED] OpenVPN and Pi-Hole. Clients unable to reach the network

Hi!
I succefully installed and configured pi-hole and i am able to use it in my local network.
Now i'd like to use it with my mobile devices when i'm away. So i tried to install openvpn. Unluckly i'm not able to use it with my android clients.
My opnvpn server is in the same machine where is running pi-hole, its address in my local network is 192.168.1.110

server.conf

port 1194
proto tcp
dev tun
ca /etc/openvpn/server/ca.crt
cert /etc/openvpn/server/homeserver.crt
dh /etc/openvpn/server/dh.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.1.0 255.255.255.0"
push "route 10.8.0.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 192.168.1.110"
client-to-client
duplicate-cn
keepalive 10 120
cipher AES-256-CBC
auth SHA512
tls-version-min 1.2
tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-128-GCM-SHA256:TLS-DHE-RSA-WITH-AES-256-CBC-SHA:TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA:TLS-DHE-RSA-WITH-AES-128-CBC-SHA:TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA
user nobody
group nobody
persist-key
persist-tun
status /var/log/openvpn-status.log
log         /var/log/openvpn.log
verb 6

client.conf

client
dev tun
remote *******.** 1194 tcp
resolv-retry infinite
nobind
persist-key
persist-tun
verb 3
cipher AES-256-CBC
auth SHA512
tls-version-min 1.2
tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-128-GCM-SHA256:TLS-DHE-RSA-WITH-AES-256-CBC-SHA:TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA:TLS-DHE-RSA-WITH-AES-128-CBC-SHA:TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA
remote-cert-tls server
key-direction 1

Here's the result when i try to connect with my mobile device. The client was connecting as well with the server, but internet is unreachable.

In the server log i found some error like this

 Sun Jun 18 14:11:44 2017 us=888154 client1/X.X.X.X:59350 MULTI: bad source address from client [X.X.X.X], packet dropped

Anybody can help me to find what my problem is?
If you need more just ask!

***EDIT***
After some investigation and a good howto linked here from graysky, i fanally found a working configuration.

I added in /etc/dnsmasq.d/01-pihole-init.conf

interface=tun0

then i changed server.conf

port 1194
proto tcp
dev tun

ca /etc/openvpn/server/ca.crt
cert /etc/openvpn/server/homeserver.crt
dh /etc/openvpn/server/dh.pem
key /etc/easy-rsa/pki/private/homeserver.key

server 10.8.0.0 255.255.255.0
ifconfig 10.8.0.1 10.8.0.2

push "route 10.8.0.1 255.255.255.0"
push "route 10.8.0.0 255.255.255.0"
push "route 192.168.1.0 255.255.255.0"
push "dhcp-option DNS 10.8.0.1"

keepalive 10 120

cipher AES-256-CBC
auth SHA512
tls-version-min 1.2
tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-128-GCM-SHA256:TLS-DHE-RSA-WITH-AES-256-CBC-SHA:TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA:TLS-DHE-RSA-WITH-AES-128-CBC-SHA:TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA
tls-auth /etc/openvpn/server/ta.key 0

user nobody
group nobody

persist-key
persist-tun

verb 6

Finally the client.conf

client
dev tun
proto tcp
remote *******.** 1194
resolv-retry infinite
nobind
persist-key
persist-tun
key-direction 1
remote-cert-tls server
tls-version-min 1.2
verify-x509-name server name
cipher AES-256-CBC
auth SHA512
tls-version-min 1.2
tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-128-GCM-SHA256:TLS-DHE-RSA-WITH-AES-256-CBC-SHA:TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA:TLS-DHE-RSA-WITH-AES-128-CBC-SHA:TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA
#comp-lzo
verb 6

Thanks!

Last edited by thepasto (2017-06-23 07:42:05)

Offline

#2 2017-06-18 16:21:09

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] OpenVPN and Pi-Hole. Clients unable to reach the network

Arch ARM is a separate distribution, please ask on their boards: https://bbs.archlinux.org/viewtopic.php?id=153431



Closing -- for deletion


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-06-18 21:19:29

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] OpenVPN and Pi-Hole. Clients unable to reach the network

Reopened on appeal; apparently runs on other architectures.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2017-06-18 23:46:20

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] OpenVPN and Pi-Hole. Clients unable to reach the network

I wouldn't touch that with a 10-foot pole. From a quick look, alarm bells start ringing with the install method and keep ringing with what seems to be auto update with a cron job.

That said, you point your vpn clients to the correct dns server and it should work. You'll have to look at how the dns server is configured and make sure it accepts dns requests from the vpn.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#5 2017-06-18 23:57:26

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: [SOLVED] OpenVPN and Pi-Hole. Clients unable to reach the network

thepasto wrote:

In the server log i found some error like this

 Sun Jun 18 14:11:44 2017 us=888154 client1/X.X.X.X:59350 MULTI: bad source address from client [X.X.X.X], packet dropped

I'm guessing the censored address is not a 10.8.x.x address?  If I'm right in saying that, then I'd hazard to say that the problem is with your client and its source address selection which isn't something we can help with here most likely.

R00KIE wrote:

I wouldn't touch that with a 10-foot pole. From a quick look, alarm bells start ringing with the install method and keep ringing with what seems to be auto update with a cron job.

I use Pi-Hole on my home network (running in a Debian VM) and it's actually quite good, despite the unorthodox install/update methods.

Offline

#6 2017-06-19 00:52:05

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] OpenVPN and Pi-Hole. Clients unable to reach the network

fukawi2 wrote:
R00KIE wrote:

I wouldn't touch that with a 10-foot pole. From a quick look, alarm bells start ringing with the install method and keep ringing with what seems to be auto update with a cron job.

I use Pi-Hole on my home network (running in a Debian VM) and it's actually quite good, despite the unorthodox install/update methods.

Fair enough. Did you ever investigate where they download the extra/blocked hosts list from?

I do have something similar setup (more basic, only using unbound) but I'm using everything from the repos. I do have some helper scripts I've done myself but those are only for downloading and massaging the hosts list into the proper format.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#7 2017-06-19 01:03:33

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: [SOLVED] OpenVPN and Pi-Hole. Clients unable to reach the network

R00KIE wrote:

Fair enough. Did you ever investigate where they download the extra/blocked hosts list from?

EDIT: Here's the full URL's: https://github.com/pi-hole/pi-hole/blob … ts.default

Offline

#8 2017-06-19 01:36:12

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] OpenVPN and Pi-Hole. Clients unable to reach the network

Great! Thanks smile

I might look at integrating some of those lists with the ones I already use. I do spot one I knew about but don't use, hosts-file.net. If trying to make use of the full list (not just the ad server list) it makes unbound eat more than 1GiB of memory, so let that be a tip for anyone reading this, if your list is big it can use lots of resources.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#9 2017-06-19 06:35:30

thepasto
Member
From: trash:///
Registered: 2009-03-16
Posts: 56

Re: [SOLVED] OpenVPN and Pi-Hole. Clients unable to reach the network

fukawi2 wrote:

I'm guessing the censored address is not a 10.8.x.x address?  If I'm right in saying that, then I'd hazard to say that the problem is with your client and its source address selection which isn't something we can help with here most likely.

Tanks! Yes it seems so, it's not a 10.8.X.X address.

R00KIE wrote:

I wouldn't touch that with a 10-foot pole. From a quick look, alarm bells start ringing with the install method and keep ringing with what seems to be auto update with a cron job.
That said, you point your vpn clients to the correct dns server and it should work. You'll have to look at how the dns server is configured and make sure it accepts dns requests from the vpn.

Tanks! There's an aur package to install and update.
Anyway i think i set the right configuration on the server side, i am missing something for sure! I will investigate better in these days. Thanks again

Offline

#10 2017-06-19 13:57:39

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: [SOLVED] OpenVPN and Pi-Hole. Clients unable to reach the network

Thanks for this thread.  Pi-hole seems like an interesting project to investigate further.

@op - if you solve your issue, please update the thread with top the solution or perhaps start a wiki page.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#11 2017-06-19 17:56:09

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] OpenVPN and Pi-Hole. Clients unable to reach the network

thepasto wrote:

Tanks! There's an aur package to install and update.

That looks good and you really should use it instead of the install script, having scripts messing directly with the system is not a good idea.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#12 2017-06-22 19:51:57

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: [SOLVED] OpenVPN and Pi-Hole. Clients unable to reach the network


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#13 2017-06-23 07:43:36

thepasto
Member
From: trash:///
Registered: 2009-03-16
Posts: 56

Re: [SOLVED] OpenVPN and Pi-Hole. Clients unable to reach the network

@graysky Thank you! I finally found a working configuration! I marked this as solved with updated information on the first post!
Thanks again

Offline

#14 2017-06-23 09:56:11

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: [SOLVED] OpenVPN and Pi-Hole. Clients unable to reach the network

@op - you probably don't want to edit the original content ...  placing new content at the bottom of it showing what you did to fix it is probably more helpful to a reader finding your post in a search.  That way, he/she can see your original setup AND the needed fixes.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB