From: "cron2 (Code Review)" Date: Fri, 2 May 2025 17:13:48 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., heiko@...515..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <08eceaf55cba82586f77c79452e3821cbc77d82a-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="EHMyeitVEvs="; charset=UTF-8 Subject: [Openvpn-devel] [L] Change in openvpn[master]: dns: apply settings via script on unixoid systems List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: d12fk Cc: flichtenheld , plaisthos , openvpn-devel --EHMyeitVEvs= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: d12fk, flichtenheld, plaisthos. cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/ope= nvpn/+/838?usp=3Demail ) Change subject: dns: apply settings via script on unixoid systems ...................................................................... Patch Set 22: (3 comments) Patchset: PS22: So, tested on FreeBSD, script works. Great :-) Tested on Gentoo/resolv.conf file (does not work), and on the "debian testi= ng" box (now claims to "setting DNS using resolv.conf file") but it does no= t work either - same effect as on Gentoo, I end up with an empty `nameserve= r ` line (see copy-paste in the systemd-dns-updown.sh hunk) Tested on OpenBSD/resolv.conf file (does not work, different error) (see th= ere). Also, it does not do anything for incoming pushed DHCP_OPTION DNS - dependi= ng on client UV_WANT_DNS I push DHCP-Options that are properly reflected to= an ``--up`` script, but the `--dns-updown` script is not run at all. This= is not how I understand what it should do - is this fixed in a later patch= in the series? File distro/dns-scripts/resolvconf_file-dns-updown.sh: http://gerrit.openvpn.net/c/openvpn/+/838/comment/a6af4a0f_484144cd : PS22, Line 85: so, tested this on OpenBSD (7.6) and it does not work Incoming push info as on Linux (`,dns server 1 address 10.194.0.1,dns serve= r 1 address fd00:abcd:194::1,dns server 2 resolve-domains open.vpn,dns serv= er 2 address 10.194.1.1,dns server 2 address fd00:abcd:194:1::1`) and the s= cript dies with ``` 2025-05-02 18:54:28 distro/dns-scripts/dns-updown sed: 1: "1i### openvpn tun1 begi ...: command i expects \ followed by text 2025-05-02 18:54:28 dns up command exited with status 1 ``` and nothing gets changed. File distro/dns-scripts/systemd-dns-updown.sh: http://gerrit.openvpn.net/c/openvpn/+/838/comment/9a1615d4_fd1db246 : PS22, Line 231: } this looks like it should work, but it doesn't behave for me... Gentoo, aga= in, with pushed `--dns` settings, and the resulting resolv.conf looks like = this: ``` ### openvpn tun8 begin ### nameserver ### openvpn tun8 end ### # Generated by netifrc for interface enp2s1 domain ov.greenie.net nameserver 2001:608::2 nameserver 195.30.0.1 nameserver 195.30.0.2 ``` the client invocation is like this (with the reference server that pushes -= -dns or --dhcp-option dns, depending on UV_WANT_DNS): ``` openvpn --client --ca /home/gert/t_client_keys/ca.crt --cert /home/ger= t/t_client_keys/cron2-gentoo.ov-amd64.crt --key /home/gert/t_client_keys/cr= on2-gentoo.ov-amd64.key --remote-cert-tls server --nobind --comp-lzo -= -verb 3 --tls-cert-profile insecure --dev tun --proto udp6 --remote= conn-test-server.openvpn.org --port 51194 --push-peer-info --setenv UV_WAN= T_DNS dns --dns-updown ./distro/dns-scripts/dns-updown --script-security 2 ``` and the server pushes ``` dns server 1 resolve-domains open.vpn,dns server 1 address 10.194.0.1,dns s= erver 1 address fd00:abcd:194::1,dns server 2 resolve-domains open.vpn,dns = server 2 address 10.194.1.1,dns server 2 address fd00:abcd:194:1::1 ``` client logs ``` 2025-05-02 18:42:38 distro/dns-scripts/dns-updown setting DNS using resolv.conf file 2025-05-02 18:42:38 dns up command exited with status 0 ``` -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/838?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ifbe4ffb44d3bfcaa50adb38cacb3436fcdc71b10 Gerrit-Change-Number: 838 Gerrit-PatchSet: 22 Gerrit-Owner: d12fk Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-Attention: d12fk Gerrit-Comment-Date: Fri, 02 May 2025 17:13:48 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment --EHMyeitVEvs= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: d12fk, flichtenheld, plaisthos. <= /p>

View C= hange

3 comments:

    =
  • Patchset:

    • Patch Set #22:

      So, tested on FreeBSD, script works. Great :-)<= br>Tested on Gentoo/resolv.conf file (does not work), and on the "debi= an testing" box (now claims to "setting DNS using resolv.conf fil= e") but it does not work either - same effect as on Gentoo, I end up w= ith an empty `nameserver <nothing>` line (see copy-paste in the syste= md-dns-updown.sh hunk)
      Tested on OpenBSD/resolv.conf file (does not work= , different error) (see there).

      Also, it does not do anything for incoming pushed DHCP_O= PTION DNS - depending on client UV_WANT_DNS I push DHCP-Options that are pr= operly reflected to an ``--up`` script, but the `--dns-updown` script is no= t run at all. This is not how I understand what it should do - is this fix= ed in a later patch in the series?

  • File distro/dns-scripts/resolvconf_file-dns-updown.sh:

    • Patch Set #22, Line 8= 5:

      so, tested this on OpenB= SD (7.6) and it does not work

      Incoming push info as on Linux (`,dns server 1 address 10.= 194.0.1,dns server 1 address fd00:abcd:194::1,dns server 2 resolve-domains = open.vpn,dns server 2 address 10.194.1.1,dns server 2 address fd00:abcd:194= :1::1`) and the script dies with

      ```
      2025-05-02 18:54:28 distro/dns-scripts/dns-updow= n
      sed: 1: "1i### openvpn tun1 begi ...: command i expects \ followe= d by text
      2025-05-02 18:54:28 dns up command exited with status 1
      ```=

      and nothing = gets changed.

  • Fil= e distro/dns-scripts/systemd-dns-updown.sh:

    • Patch Set #22, Line 231: }

      this looks like it should work, but it doesn't b= ehave for me... Gentoo, again, with pushed `--dns` settings, and the result= ing resolv.conf looks like this:

      ```
      ### openvpn tun8 begin ###
      nameserver
      ###= openvpn tun8 end ###
      # Generated by netifrc for interface enp2s1
      dom= ain ov.greenie.net
      nameserver 2001:608::2
      nameserver 195.30.0.1
      na= meserver 195.30.0.2
      ```

      the client invocation is like this (with the reference server= that pushes --dns or --dhcp-option dns, depending on UV_WANT_DNS):

      ```
      openvpn --cli= ent --ca /home/gert/t_client_keys/ca.crt --cert /home/gert/t_client_ke= ys/cron2-gentoo.ov-amd64.crt --key /home/gert/t_client_keys/cron2-gentoo.ov= -amd64.key --remote-cert-tls server --nobind --comp-lzo --verb 3 = --tls-cert-profile insecure --dev tun --proto udp6 --remote conn-test-se= rver.openvpn.org --port 51194 --push-peer-info --setenv UV_WANT_DNS dns --d= ns-updown ./distro/dns-scripts/dns-updown --script-security 2
      ```

      and the server push= es
      ```
      dns server 1 resolve-domains open.vpn,dns server 1 address 10.= 194.0.1,dns server 1 address fd00:abcd:194::1,dns server 2 resolve-domains = open.vpn,dns server 2 address 10.194.1.1,dns server 2 address fd00:abcd:194= :1::1
      ```

      = client logs
      ```
      2025-05-02 18:42:38 distro/dns-scripts/dns-updown
      = setting DNS using resolv.conf file
      2025-05-02 18:42:38 dns up command ex= ited with status 0
      ```

To view, visit change 838. = To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ifbe4ffb44d3bfcaa50adb38cacb= 3436fcdc71b10
Gerrit-Change-Number: 838
Gerrit-PatchSet: 22
Gerrit-Owner: d12fk <heiko@...515...>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Attention: d12fk <heiko@...515...>= ;
Gerrit-Comment-Date: Fri, 02 May 2025 17:13:48= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
--EHMyeitVEvs=--