joshmarch
I am trying to set up OpenVPN on my raspberry pi to only tunnel traffic connecting to devices on the local network, not internet data.
I have tried with the config below which works fine on my iPhone with the OpenVPN connect app, but when I used the same profile on a PC it lost all internet connection (but could connect to the local network). 192.168.0.0 is the local network where the VPN is hosted.
dev tun
proto udp
port 1194
ca /etc/openvpn/easy-rsa/pki/ca.crt
cert /etc/openvpn/easy-rsa/pki/issued/raspberrypi_958eb652-c7c0-4174-a49b-a20bf646765e.crt
key /etc/openvpn/easy-rsa/pki/private/raspberrypi_958eb652-c7c0-4174-a49b-a20bf646765e.key
dh none
topology subnet
server 10.69.0.0 255.255.255.0
# Set your primary domain name server address for clients
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
# Prevent DNS leaks on Windows
push "block-outside-dns"
# Override the Client default gateway by using 0.0.0.0/1 and
# 128.0.0.0/1 rather than 0.0.0.0/0. This has the benefit of
# overriding but not wiping out the original default gateway.
#push "redirect-gateway def1"
push "route 192.168.0.0 255.255.255.0"
client-to-client
keepalive 1800 3600
remote-cert-tls client
tls-version-min 1.2
tls-crypt /etc/openvpn/easy-rsa/pki/ta.key
cipher AES-256-CBC
auth SHA256
user nobody
group nogroup
persist-key
persist-tun
crl-verify /etc/openvpn/crl.pem
status /var/log/openvpn-status.log 20
status-version 3
syslog
verb 3
#DuplicateCNs allow access control on a less-granular, per user basis.
#Remove # if you will manage access by user instead of device.
#duplicate-cn
# Generated for use by PiVPN.io
Can anyone see where I'm going wrong here?