Pihole doesn't work in openvpn

Expected behavior:

Pihole in Wireguard and Openvpn.
I need server 2 to work the same as server 1.

Server 1, this works.

OS: Ubuntu 18.04.4 LTS x86_64
Host: VMware Virtual Platform None
Kernel: 4.15.0-99-generic
Shell: bash 4.4.20
CPU: Intel Xeon E7- 2850 (1) @ 1,997GHz
Memory: 345MiB / 962MiB

Server 2, this does not work.

OS: Ubuntu 18.04.4 LTS x86_64
Host: Hyper-V UEFI virtual machine version v1.0
Kernel: 4.15.0-101-generic
Shell: bash 4.4.20
CPU: Intel Xeon E5-2698 v3 (2) @ 2,299GHz
Memory: 216MiB / 1979MiB

I use www.pivpn.io to install Wireguard.

Current behavior:

Server 1 runs pihole on Openvpn and Wireguard.
Server 2 works pihole on Wireguard but not on Openvpn.
I need server 2 to work the same as server 1.

Server 1 Server.conf

topology subnet
server 10.8.0.0 255.255.255.0
verb 0

duplicate-cn

key client-key.pem
ca ca.pem
cert client-cert.pem
dh dh.pem
persistent key
persist-tun
comp-lzo
float
press "redirect-gateway def1 bypass-dhcp"
press "dhcp-option DNS 10.6.0.1"
#push "dhcp-option DNS 8.8.8.8"
#push "dhcp-option DNS 8.8.4.4"

user nobody
nogroup group

AES-128-CBC figure
proto tcp
port 4433
Dev Tun
status openvpn-status.log
customer to customer
client certificate not required
username as common name
plugin /usr/lib/openvpn/plugins/openvpn-plugin-auth-pam.so login

connect-retry 0 0
reneg-sec 0
tran window 0
hand window 120
keepalive 10 120

Server 2 Server.conf

topology subnet
server 10.8.0.0 255.255.255.0
verb 0

duplicate-cn

key client-key.pem
ca ca.pem
cert client-cert.pem
dh dh.pem
persistent key
persist-tun
comp-lzo
float
press "redirect-gateway def1 bypass-dhcp"
press "dhcp-option DNS 10.6.0.1"
#push "dhcp-option DNS 8.8.8.8"
#push "dhcp-option DNS 8.8.4.4"

user nobody
nogroup group

AES-128-CBC figure
proto tcp
port 4433
Dev Tun
status openvpn-status.log
customer to customer
client certificate not required
username as common name
plugin /usr/lib/x86_64-linux-gnu/openvpn/plugins/openvpn-plugin-auth-pam.so login

connect-retry 0 0
reneg-sec 0
tran window 0
hand window 120
keepalive 10 120

Server 1 Pivpn Wireguard:

=============================================
:::: Installation configuration ::::
PLAT = Ubuntu
OSCN = bionic
USING_UFW = 0
IPv4dev = ens160
install_user = user321
install_home = / home / user321
VPN = cable protection
pivpnPORT = 20276
pivpnDNS1 = 10.6.0.1
pivpnDNS2 =
pivpnHOST = REMOVED
INPUT_CHAIN_EDITED = 0
FORWARD_CHAIN_EDITED = 0
pivpnPROTO = udp
pivpnDEV = wg0
pivpnNET = 10.6.0.0
subnetClass = 24
UNATTUPG = 1
INSTALLED_PACKAGES = ()

:::: The server configuration is shown below ::::
[Interface]
PrivateKey = server_priv
Address = 10.6.0.1/24
ListenPort = 20276

Server 2 Pivpn Wireguard:

=============================================
:::: Installation configuration ::::
PLAT = Ubuntu
OSCN = bionic
USING_UFW = 1
IPv4dev = eth0
install_user = user321
install_home = / home / user321
VPN = cable protection
pivpnPORT = 20276
pivpnDNS1 = 10.6.0.1
pivpnDNS2 =
pivpnHOST = REMOVED
pivpnPROTO = udp
pivpnDEV = wg0
pivpnNET = 10.6.0.0
subnetClass = 24
UNATTUPG = 1
INSTALLED_PACKAGES = ()

:::: The server configuration is shown below ::::
[Interface]
PrivateKey = server_priv
Address = 10.6.0.1/24
ListenPort = 20276

Debug Token:

Server 1: https://tricorder.pi-hole.net/tdvecvseqv
Server 2: https://tricorder.pi-hole.net/27dp099eh4

I put pihole in tun0 with 10.9.0.1, then I configured the vpn I had in tun0 and tun1 with dns 10.9.0.1, then I configured wireguard with dns 10.9.0.1 and it worked in 3, tun0, tun1 and wg0.
Then check:
Listening behavior interface
Listen on all interfaces
Allows only queries from devices that are within a hop maximum (local devices)

This works for me, but when I set pihole to eth0 it doesn't work by default.
Why?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.