No internet access via OpenVPN

No internet access via OpenVPN

While searching online I found this: link
I tried that and now my vpn works fine but the dns is not working anymore, because I commented it out. Can someone help me why the dns not works in openvpn. I was using this. I'm trying to get it work on my phone. Not tried it on my pc.

Config files:

Dnsmasq.conf:

conf-dir=/etc/dnsmasq.d
listen-address=127.0.0.1, 192.168.1.186, 10.8.0.1

2nd dnsmasq config(02-pihole.conf)

local=/lan/
local=/mijnmodem.kpn/
local=/local/
local=/lammetjes.net/

interface=eth0
interface=tun0

Server.conf:

port 1194
proto udp
dev tun
sndbuf 0
rcvbuf 0
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
tls-auth ta.key 0
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def0"
keepalive 10 120
cipher AES-256-CBC
user nobody
group nogroup

setupVars.conf:

BLOCKING_ENABLED=true
WEBPASSWORD=Edited
TEMPERATUREUNIT=C
ADMIN_EMAIL=Edited
WEBUIBOXEDLAYOUT=boxed
PIHOLE_INTERFACE=eth0
PIHOLE_INTERFACE=tun0
IPV4_ADDRESS=192.168.1.186/24
IPV6_ADDRESS=
QUERY_LOGGING=true
INSTALL_WEB_SERVER=true
INSTALL_WEB_INTERFACE=true
LIGHTTPD_ENABLED=true
DNSMASQ_LISTENING=all
PIHOLE_DNS_1=1.1.1.1
PIHOLE_DNS_2=1.0.0.1
PIHOLE_DNS_3=127.0.0.1#5053
DNS_FQDN_REQUIRED=false
DNS_BOGUS_PRIV=false

(Things below is with dns defined in config)

Expected Behaviour:

Have internet with blocked ads and access to local domains.

Actual Behaviour:

No access to internet and local domains. If I put the ip of the website it works.

Debug Token:

coymrnocp0

Note: If you look at the debug it will say gateway not available. Not sure why it says that, because when I try to ping it manually it gives packages back with 0 packets lost.

You are missing the parameter for the DNS. You are connecting to the VPN OK however, no DNS is specified.
edit this line:

push "redirect-gateway def0 bypass-dhcp"

add the following line to your server.conf, restart and test:

push "dhcp-option DNS 10.8.0.1"

(you probably missed that parameter since the guide tells you to use it).

1 Like

Ok, will try that tomorrow. Will let you know if it worked.

Already fixed it, my port forward didn't save correctly

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