I have set up an OPNSense instance and installed an OpenVPN server via it. You can see the client configuration below and it works so far. I get a successful connection via the OpenVPN-Client. The problem is that with foreign clients, the internal DNS does not work. Clients that are already in the domain work without problems and also have access to all network drives with the corresponding name from the internal DNS. Foreign clients which are not in the domain, can't resolve the network drives e.g.
What I've tried so far:
- Provide a DNS server list to clients via the OpenVPN-Server Settings in OPNsense
- Provide a default domain name to clients
- Run "net stop dnscache", "net start dnscache", "ipconfig/flushdns", "ipconfig/registerdns" on connection initation
- Enter IP addresses to be used by the system for DNS resolution in the general settings of OPNsense
- Set Firewall-Rules (Tunnel-Networkrange pass from all Port to every Destination + Dest-Port)
- Played with Unbound DNS - but only superficial
- Added push "dhcp-option DNS 192.168.1.200" and push "dhcp-option DOMAIN [REDACTED]" in the client-config
Would anyone know what else I could try?
Thanks!
dev tun
persist-tun
persist-key
cipher AES-256-CBC
auth SHA512
client
resolv-retry infinite
remote [REDACTED] 1194 udp
lport 0
verify-x509-name "C=[REDACTED], ST=[REDACTED], L=[REDACTED], O=[REDACTED], emailAddress=[REDACTED], CN=[REDACTED]" subject
remote-cert-tls server
auth-user-pass
push "dhcp-option DNS 192.168.1.200"
push "dhcp-option DOMAIN [REDACTED]"
<ca>
-----BEGIN CERTIFICATE-----
[REDACTED]
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
[REDACTED]
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
[REDACTED]
-----END PRIVATE KEY-----
</key>
<tls-auth>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
[REDACTED]
-----END OpenVPN Static key V1-----
</tls-auth>
key-direction 1