Can't push DNS option to Windows OpenVPN clients

I am running a OpenVPN Server on a MT3000 in drop-in gateway mode firmware 4.8.3 op24. Everything works except my Windows clients don’t get the correct DNS Server assigned. When a Windows client connects, “ERR_INVALID_OPTION_DNS: option_error” is seen in the client logs, ‘dhcp-option’ must have exactly 3 arguments”

The “push dhcp-option” configured in /etc/openvpn/ovpn/server.ovpn is ignored

The “push dhcp-option” in /var/ovpnserver/ovpnserver is “push “dhcp-option DNS “ which is indeed missing the 3rd argument.

What is the /var/ovpnserver/openvpnserver file getting this DNS server setting from, and how can I assign it the proper value. Manually editing the file in var doesn’t work because it just resets whenever the OpenVPN server is restarted and the setting never applies

See exactly what process owns and writes the runtime file

ls -la /var/ovpnserver/
cat /var/ovpnserver/ovpnserver

To know what writes the file at boot.

There maybe a glinet specific configuration file but im not sure of it.

I think GLinet is reading uci variables to generate the /var/ovpnserver/ovpnserver file, but I can’t figure out which variable it is trying to read the DNS variable from.

Hi

Thanks for the report.
We have reproduced the issue locally and will ask the R&D team to fix it.

For now, you can try manually editing /lib/netifd/proto/ovpnserver.sh to address the issue.