OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • 24.1 Legacy Series »
  • Cannot setup OpenVPN Server
« previous next »
  • Print
Pages: [1]

Author Topic: Cannot setup OpenVPN Server  (Read 1717 times)

3isenHeiM

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Cannot setup OpenVPN Server
« on: February 09, 2024, 10:38:32 pm »
I've followed the Road Warrior article adapted for the new version.

However, in the logs I have this message :

Code: [Select]
/usr/local/opnsense/scripts/openvpn/ovpn_service_control.php: The command '/usr/local/sbin/openvpn --config '/var/etc/openvpn/instance-551f641a-4238-41f4-a0d9-eddd9b72ebff.conf'' returned exit code '1', the output was 'Options error: error parsing --server parameters Use --help for more information.'
Here is the configuration file mentionned in the comand :

Code: [Select]
push "redirect-gateway def1"
push "route 192.168.99.0 255.255.255.0"
dev ovpns2
ping-timer-rem
topology subnet
dh /usr/local/etc/inc/plugins.inc.d/openvpn/dh.rfc7919
verify-client-cert require
server 10.164.136.1 0.0.0.0
client-config-dir /var/etc/openvpn-csc/2
auth-user-pass-verify "/usr/local/opnsense/scripts/openvpn/ovpn_event.py --defer '551f641a-4238-41f4-a0d9-eddd9b72ebff'" via-env
learn-address "/usr/local/opnsense/scripts/openvpn/ovpn_event.py '2'"
client-disconnect "/usr/local/opnsense/scripts/openvpn/ovpn_event.py '551f641a-4238-41f4-a0d9-eddd9b72ebff'"
tls-verify "/usr/local/opnsense/scripts/openvpn/ovpn_event.py '551f641a-4238-41f4-a0d9-eddd9b72ebff'"
persist-tun
persist-key
dev-type tun
dev-node /dev/tun2
script-security 3
writepid /var/run/ovpn-instance-551f641a-4238-41f4-a0d9-eddd9b72ebff.pid
daemon openvpn_server2
management /var/etc/openvpn/instance-551f641a-4238-41f4-a0d9-eddd9b72ebff.sock unix
proto udp4
verb 3
up /usr/local/etc/inc/plugins.inc.d/openvpn/ovpn-linkup
down /usr/local/etc/inc/plugins.inc.d/openvpn/ovpn-linkdown
port 1194
local 255.255.255.0
client-to-client

I believe it's the line

Code: [Select]
server 10.164.136.1 0.0.0.0
That poses problem. The manpage of the opnvpn binary mentions this :

Code: [Select]
Multi-Client Server options (when --mode server is used):
--server network netmask : Helper option to easily configure server mode.

In my opition, the 0.0.0.0 should be replaced by the netmask of the server. How can I achieve this ?

Thanks
Logged

3isenHeiM

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: Cannot setup OpenVPN Server
« Reply #1 on: February 10, 2024, 08:50:57 pm »
The issue was related to not setting a network address in the field "server".

Setting a Network IP/Netmask solved the issue.
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • 24.1 Legacy Series »
  • Cannot setup OpenVPN Server
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2