OpenVPN 和 DNS 错误

OpenVPN 和 DNS 错误

我正在使用 Ubuntu18.04.6,OpenVPN 2.5.2。我使用 .ovpn 文件进行连接:

sudo openvpn --config name.ovpn

我收到错误:

Options error: Unrecognized option or missing or extra 
  parameter(s) in [PUSH-OPTIONS]:6: block-outside-dns (2.5.2)
Options error: Unrecognized option or missing or extra 
  parameter(s) in [PUSH-OPTIONS]:7: register-dns (2.5.2)

从类似的问题中了解到有关将这些行添加到.ovpn 的信息:

script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf

但我仍然得到同样的错误

从类似的问题来看,答案没有帮助

完整日志

    2022-04-11 00:34:19 NOTE: the current --script-security setting may allow this 
         configuration to call user-defined scripts
    2022-04-11 00:34:19 TCP/UDP: Preserving recently used remote address: 
     [AF_INET]93.174.229.64:1194
   2022-04-11 00:34:19 UDPv4 link local: (not bound)
   2022-04-11 00:34:19 UDPv4 link remote: [AF_INET]93.174.229.64:1194
   2022-04-11 00:34:19 [OpenVPN_Cert] Peer Connection Initiated with 
     [AF_INET]93.174.229.64:1194
   2022-04-11 00:34:19 Options error: Unrecognized option or missing or extra 
     parameter(s) in [PUSH-OPTIONS]:6: block-outside-dns (2.5.2)
   2022-04-11 00:34:19 Options error: Unrecognized option or missing or extra 
     parameter(s) in [PUSH-OPTIONS]:7: register-dns (2.5.2)
   2022-04-11 00:34:19 TUN/TAP device tun0 opened
   2022-04-11 00:34:19 net_iface_mtu_set: mtu 1500 for tun0
   2022-04-11 00:34:19 net_iface_up: set tun0 up
   2022-04-11 00:34:19 net_addr_v4_add: 192.168.77.48/24 dev tun0
   2022-04-11 00:34:19 /etc/openvpn/update-resolv-conf tun0 1500 1553 192.168.77.48 
   255.255.255.0 init
   dhcp-option DOMAIN echelon.lan
   dhcp-option DNS 10.0.0.2
   dhcp-option DNS 10.0.0.5
   Too few arguments.
   Too few arguments.
   2022-04-11 00:34:19 Initialization Sequence Completed

.ovpn 文件如下所示:

   dev tun
   persist-tun
   persist-key
   data-ciphers AES-128-GCM:AES-128-CBC
   data-ciphers-fallback AES-128-CBC
   auth SHA256
   tls-client
   client
   resolv-retry infinite
   remote vpn.cnpo.ru 1194 udp4
   #setenv opt block-outside-dns
   nobind
   verify-x509-name "OpenVPN_Cert" name
   auth-user-pass
   pkcs12 gate64-UDP4-1194-a.moskvitin.p12
   tls-auth gate64-UDP4-1194-a.moskvitin-tls.key 1
   remote-cert-tls server
   compress 
   explicit-exit-notify
   auth-nocache
   script-security 2
   up /etc/openvpn/update-resolv-conf
   down /etc/openvpn/update-resolv-conf

相关内容