Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[OpenVPN - Geek Version] [2.3.5] Client/Server VPN Solution
#1
[Image: OpenVPN.jpg]
Source : http://openvpn.net/

Download :

http://www.thecus-france.com/OpenVPN_2.3.2.rar [ Intel OS5 and OS6 NAS Only ]
http://www.thecus-france.com/OpenVPN_2.3.3.rar [ Intel and ppc OS5 and OS6 NAS Only ]

http://www.thecus-france.com/OpenVPN_2.3.5.rar [ Intel and ppc OS5 and OS6 NAS Only ] [ Do not upgrade ]

Note :

This a Basic Binary for OpenVPN Server
You need have some experience in command line to set it
the WebUI is a simple Startup and stop sequence to automate your command line when your NAS start and stop

All Binaries are located in /raid/data/module/OpenVPN/sys/bin

Due to lack of time and of knowledge on VPN, i didnt test it personnaly, thanks to share your experiences

Binary flag options :

Code:
./openvpn
OpenVPN 2.3.2 i686-nptl-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [eurephia] [MH] [IPv6] built on Nov 22 2013

General Options:
--config file   : Read configuration options from file.
--help          : Show options.
--version       : Show copyright and version information.

Tunnel Options:
--local host    : Local host name or ip address. Implies --bind.
--remote host [port] : Remote host name or ip address.
--remote-random : If multiple --remote options specified, choose one randomly.
--remote-random-hostname : Add a random string to remote DNS name.
--mode m        : Major mode, m = 'p2p' (default, point-to-point) or 'server'.
--proto p       : Use protocol p for communicating with peer.
                  p = udp (default), tcp-server, or tcp-client
--proto-force p : only consider protocol p in list of connection profiles.
                  p = udp6, tcp6-server, or tcp6-client (ipv6)
--connect-retry n : For --proto tcp-client, number of seconds to wait
                    between connection retries (default=5).
--connect-timeout n : For --proto tcp-client, connection timeout (in seconds).
--connect-retry-max n : Maximum connection attempt retries, default infinite.
--http-proxy s p [up] [auth] : Connect to remote host
                  through an HTTP proxy at address s and port p.
                  If proxy authentication is required,
                  up is a file containing username/password on 2 lines, or
                  'stdin' to prompt from console.  Add auth='ntlm' if
                  the proxy requires NTLM authentication.
--http-proxy s p 'auto[-nct]' : Like the above directive, but automatically
                  determine auth method and query for username/password
                  if needed.  auto-nct disables weak proxy auth methods.
--http-proxy-retry     : Retry indefinitely on HTTP proxy errors.
--http-proxy-timeout n : Proxy timeout in seconds, default=5.
--http-proxy-option type [parm] : Set extended HTTP proxy options.
                                  Repeat to set multiple options.
                  VERSION version (default=1.0)
                  AGENT user-agent
--socks-proxy s [p] [up] : Connect to remote host through a Socks5 proxy at
                  address s and port p (default port = 1080).
                  If proxy authentication is required,
                  up is a file containing username/password on 2 lines, or
                  'stdin' to prompt for console.
--socks-proxy-retry : Retry indefinitely on Socks proxy errors.
--resolv-retry n: If hostname resolve fails for --remote, retry
                  resolve for n seconds before failing (disabled by default).
                  Set n="infinite" to retry indefinitely.
--float         : Allow remote to change its IP address/port, such as through
                  DHCP (this is the default if --remote is not used).
--ipchange cmd  : Run command cmd on remote ip address initial
                  setting or change -- execute as: cmd ip-address port#
--port port     : TCP/UDP port # for both local and remote.
--lport port    : TCP/UDP port # for local (default=1194). Implies --bind.
--rport port    : TCP/UDP port # for remote (default=1194).
--bind          : Bind to local address and port. (This is the default unless
                  --proto tcp-client or --http-proxy or --socks-proxy is used).
--nobind        : Do not bind to local address and port.
--dev tunX|tapX : tun/tap device (X can be omitted for dynamic device.
--dev-type dt   : Which device type are we using? (dt = tun or tap) Use
                  this option only if the tun/tap device used with --dev
                  does not begin with "tun" or "tap".
--dev-node node : Explicitly set the device node rather than using
                  /dev/net/tun, /dev/tun, /dev/tap, etc.
--lladdr hw     : Set the link layer address of the tap device.
--topology t    : Set --dev tun topology: 'net30', 'p2p', or 'subnet'.
--tun-ipv6      : Build tun link capable of forwarding IPv6 traffic.
--ifconfig l rn : TUN: configure device to use IP address l as a local
                  endpoint and rn as a remote endpoint.  l & rn should be
                  swapped on the other peer.  l & rn must be private
                  addresses outside of the subnets used by either peer.
                  TAP: configure device to use IP address l as a local
                  endpoint and rn as a subnet mask.
--ifconfig-ipv6 l r : configure device to use IPv6 address l as local
                      endpoint (as a /64) and r as remote endpoint
--ifconfig-noexec : Don't actually execute ifconfig/netsh command, instead
                    pass --ifconfig parms by environment to scripts.
--ifconfig-nowarn : Don't warn if the --ifconfig option on this side of the
                    connection doesn't match the remote side.
--route network [netmask] [gateway] [metric] :
                  Add route to routing table after connection
                  is established.  Multiple routes can be specified.
                  netmask default: 255.255.255.255
                  gateway default: taken from --route-gateway or --ifconfig
                  Specify default by leaving blank or setting to "nil".
--route-ipv6 network/bits [gateway] [metric] :
                  Add IPv6 route to routing table after connection
                  is established.  Multiple routes can be specified.
                  gateway default: taken from --route-ipv6-gateway or --ifconfig
--max-routes n :  Specify the maximum number of routes that may be defined
                  or pulled from a server.
--route-gateway gw|'dhcp' : Specify a default gateway for use with --route.
--route-metric m : Specify a default metric for use with --route.
--route-delay n [w] : Delay n seconds after connection initiation before
                  adding routes (may be 0).  If not specified, routes will
                  be added immediately after tun/tap open.  On Windows, wait
                  up to w seconds for TUN/TAP adapter to come up.
--route-up cmd  : Run command cmd after routes are added.
--route-pre-down cmd : Run command cmd before routes are removed.
--route-noexec  : Don't add routes automatically.  Instead pass routes to
                  --route-up script using environmental variables.
--route-nopull  : When used with --client or --pull, accept options pushed
                  by server EXCEPT for routes and dhcp options.
--allow-pull-fqdn : Allow client to pull DNS names from server for
                    --ifconfig, --route, and --route-gateway.
--redirect-gateway [flags]: Automatically execute routing
                  commands to redirect all outgoing IP traffic through the
                  VPN.  Add 'local' flag if both OpenVPN servers are directly
                  connected via a common subnet, such as with WiFi.
                  Add 'def1' flag to set default route using using 0.0.0.0/1
                  and 128.0.0.0/1 rather than 0.0.0.0/0.  Add 'bypass-dhcp'
                  flag to add a direct route to DHCP server, bypassing tunnel.
                  Add 'bypass-dns' flag to similarly bypass tunnel for DNS.
--redirect-private [flags]: Like --redirect-gateway, but omit actually changing
                  the default gateway.  Useful when pushing private subnets.
--client-nat snat|dnat network netmask alias : on client add 1-to-1 NAT rule.
--push-peer-info : (client only) push client info to server.
--setenv name value : Set a custom environmental variable to pass to script.
--setenv FORWARD_COMPATIBLE 1 : Relax config file syntax checking to allow
                  directives for future OpenVPN versions to be ignored.
--script-security level: Where level can be:
                  0 -- strictly no calling of external programs
                  1 -- (default) only call built-ins such as ifconfig
                  2 -- allow calling of built-ins and scripts
                  3 -- allow password to be passed to scripts via env
--shaper n      : Restrict output to peer to n bytes per second.
--keepalive n m : Helper option for setting timeouts in server mode.  Send
                  ping once every n seconds, restart if ping not received
                  for m seconds.
--inactive n [bytes] : Exit after n seconds of activity on tun/tap device
                  produces a combined in/out byte count < bytes.
--ping-exit n   : Exit if n seconds pass without reception of remote ping.
--ping-restart n: Restart if n seconds pass without reception of remote ping.
--ping-timer-rem: Run the --ping-exit/--ping-restart timer only if we have a
                  remote address.
--ping n        : Ping remote once every n seconds over TCP/UDP port.
--multihome     : Configure a multi-homed UDP server.
--fast-io       : (experimental) Optimize TUN/TAP/UDP writes.
--remap-usr1 s  : On SIGUSR1 signals, remap signal (s='SIGHUP' or 'SIGTERM').
--persist-tun   : Keep tun/tap device open across SIGUSR1 or --ping-restart.
--persist-remote-ip : Keep remote IP address across SIGUSR1 or --ping-restart.
--persist-local-ip  : Keep local IP address across SIGUSR1 or --ping-restart.
--persist-key   : Don't re-read key files across SIGUSR1 or --ping-restart.
--passtos       : TOS passthrough (applies to IPv4 only).
--tun-mtu n     : Take the tun/tap device MTU to be n and derive the
                  TCP/UDP MTU from it (default=1500).
--tun-mtu-extra n : Assume that tun/tap device might return as many
                  as n bytes more than the tun-mtu size on read
                  (default TUN=0 TAP=32).
--link-mtu n    : Take the TCP/UDP device MTU to be n and derive the tun MTU
                  from it.
--mtu-disc type : Should we do Path MTU discovery on TCP/UDP channel?
                  'no'    -- Never send DF (Don't Fragment) frames
                  'maybe' -- Use per-route hints
                  'yes'   -- Always DF (Don't Fragment)
--mtu-test      : Empirically measure and report MTU.
--fragment max  : Enable internal datagram fragmentation so that no UDP
                  datagrams are sent which are larger than max bytes.
                  Adds 4 bytes of overhead per datagram.
--mssfix [n]    : Set upper bound on TCP MSS, default = tun-mtu size
                  or --fragment max value, whichever is lower.
--sndbuf size   : Set the TCP/UDP send buffer size.
--rcvbuf size   : Set the TCP/UDP receive buffer size.
--mark value    : Mark encrypted packets being sent with value. The mark value
                  can be matched in policy routing and packetfilter rules.
--txqueuelen n  : Set the tun/tap TX queue length to n (Linux only).
--memstats file : Write live usage stats to memory mapped binary file.
--mlock         : Disable Paging -- ensures key material and tunnel
                  data will never be written to disk.
--up cmd        : Run command cmd after successful tun device open.
                  Execute as: cmd tun/tap-dev tun-mtu link-mtu \
                              ifconfig-local-ip ifconfig-remote-ip
                  (pre --user or --group UID/GID change)
--up-delay      : Delay tun/tap open and possible --up script execution
                  until after TCP/UDP connection establishment with peer.
--down cmd      : Run command cmd after tun device close.
                  (post --user/--group UID/GID change and/or --chroot)
                  (command parameters are same as --up option)
--down-pre      : Run --down command before TUN/TAP close.
--up-restart    : Run up/down commands for all restarts including those
                  caused by --ping-restart or SIGUSR1
--user user     : Set UID to user after initialization.
--group group   : Set GID to group after initialization.
--chroot dir    : Chroot to this directory after initialization.
--cd dir        : Change to this directory before initialization.
--daemon [name] : Become a daemon after initialization.
                  The optional 'name' parameter will be passed
                  as the program name to the system logger.
--syslog [name] : Output to syslog, but do not become a daemon.
                  See --daemon above for a description of the 'name' parm.
--inetd [name] ['wait'|'nowait'] : Run as an inetd or xinetd server.
                  See --daemon above for a description of the 'name' parm.
--log file      : Output log to file which is created/truncated on open.
--log-append file : Append log to file, or create file if nonexistent.
--suppress-timestamps : Don't log timestamps to stdout/stderr.
--writepid file : Write main process ID to file.
--nice n        : Change process priority (>0 = lower, <0 = higher).
--echo [parms ...] : Echo parameters to log output.
--verb n        : Set output verbosity to n (default=1):
                  (Level 3 is recommended if you want a good summary
                  of what's happening without being swamped by output).
                : 0 -- no output except fatal errors
                : 1 -- startup info + connection initiated messages +
                       non-fatal encryption & net errors
                : 2,3 -- show TLS negotiations & route info
                : 4 -- show parameters
                : 5 -- show 'RrWw' chars on console for each packet sent
                       and received from TCP/UDP (caps) or tun/tap (lc)
                : 6 to 11 -- debug messages of increasing verbosity
--mute n        : Log at most n consecutive messages in the same category.
--status file n : Write operational status to file every n seconds.
--status-version [n] : Choose the status file format version number.
                  Currently, n can be 1, 2, or 3 (default=1).
--disable-occ   : Disable options consistency check between peers.
--gremlin mask  : Special stress testing mode (for debugging only).
--comp-lzo      : Use fast LZO compression -- may add up to 1 byte per
                  packet for uncompressible data.
--comp-noadapt  : Don't use adaptive compression when --comp-lzo
                  is specified.
--management ip port [pass] : Enable a TCP server on ip:port to handle
                  management functions.  pass is a password file
                  or 'stdin' to prompt from console.
                  To listen on a unix domain socket, specific the pathname
                  in place of ip and use 'unix' as the port number.
--management-client : Management interface will connect as a TCP client to
                      ip/port rather than listen as a TCP server.
--management-query-passwords : Query management channel for private key
                  and auth-user-pass passwords.
--management-query-proxy : Query management channel for proxy information.
--management-query-remote : Query management channel for --remote directive.
--management-hold : Start OpenVPN in a hibernating state, until a client
                    of the management interface explicitly starts it.
--management-signal : Issue SIGUSR1 when management disconnect event occurs.
--management-forget-disconnect : Forget passwords when management disconnect
                                 event occurs.
--management-up-down : Report tunnel up/down events to management interface.
--management-log-cache n : Cache n lines of log file history for usage
                  by the management channel.
--management-client-user u  : When management interface is a unix socket, only
                              allow connections from user u.
--management-client-group g : When management interface is a unix socket, only
                              allow connections from group g.
--management-client-auth : gives management interface client the responsibility
                           to authenticate clients after their client certificate
                              has been verified.
--management-client-pf : management interface clients must specify a packet
                         filter file for each connecting client.
--plugin m [str]: Load plug-in module m passing str as an argument
                  to its initialization function.

Multi-Client Server options (when --mode server is used):
--server network netmask : Helper option to easily configure server mode.
--server-ipv6 network/bits : Configure IPv6 server mode.
--server-bridge [IP netmask pool-start-IP pool-end-IP] : Helper option to
                    easily configure ethernet bridging server mode.
--push "option" : Push a config file option back to the peer for remote
                  execution.  Peer must specify --pull in its config file.
--push-reset    : Don't inherit global push list for specific
                  client instance.
--ifconfig-pool start-IP end-IP [netmask] : Set aside a pool of subnets
                  to be dynamically allocated to connecting clients.
--ifconfig-pool-linear : Use individual addresses rather than /30 subnets
                  in tun mode.  Not compatible with Windows clients.
--ifconfig-pool-persist file [seconds] : Persist/unpersist ifconfig-pool
                  data to file, at seconds intervals (default=600).
                  If seconds=0, file will be treated as read-only.
--ifconfig-ipv6-pool base-IP/bits : set aside an IPv6 network block
                  to be dynamically allocated to connecting clients.
--ifconfig-push local remote-netmask : Push an ifconfig option to remote,
                  overrides --ifconfig-pool dynamic allocation.
                  Only valid in a client-specific config file.
--ifconfig-ipv6-push local/bits remote : Push an ifconfig-ipv6 option to
                  remote, overrides --ifconfig-ipv6-pool allocation.
                  Only valid in a client-specific config file.
--iroute network [netmask] : Route subnet to client.
--iroute-ipv6 network/bits : Route IPv6 subnet to client.
                  Sets up internal routes only.
                  Only valid in a client-specific config file.
--disable       : Client is disabled.
                  Only valid in a client-specific config file.
--client-cert-not-required : Don't require client certificate, client
                  will authenticate using username/password.
--username-as-common-name  : For auth-user-pass authentication, use
                  the authenticated username as the common name,
                  rather than the common name from the client cert.
--auth-user-pass-verify cmd method: Query client for username/password and
                  run command cmd to verify.  If method='via-env', pass
                  user/pass via environment, if method='via-file', pass
                  user/pass via temporary file.
--opt-verify    : Clients that connect with options that are incompatible
                  with those of the server will be disconnected.
--auth-user-pass-optional : Allow connections by clients that don't
                  specify a username/password.
--no-name-remapping : Allow Common Name and X509 Subject to include
                      any printable character.
--client-to-client : Internally route client-to-client traffic.
--duplicate-cn  : Allow multiple clients with the same common name to
                  concurrently connect.
--client-connect cmd : Run command cmd on client connection.
--client-disconnect cmd : Run command cmd on client disconnection.
--client-config-dir dir : Directory for custom client config files.
--ccd-exclusive : Refuse connection unless custom client config is found.
--tmp-dir dir   : Temporary directory, used for --client-connect return file and plugin communication.
--hash-size r v : Set the size of the real address hash table to r and the
                  virtual address table to v.
--bcast-buffers n : Allocate n broadcast buffers.
--tcp-queue-limit n : Maximum number of queued TCP output packets.
--tcp-nodelay   : Macro that sets TCP_NODELAY socket flag on the server
                  as well as pushes it to connecting clients.
--learn-address cmd : Run command cmd to validate client virtual addresses.
--connect-freq n s : Allow a maximum of n new connections per s seconds.
--max-clients n : Allow a maximum of n simultaneously connected clients.
--max-routes-per-client n : Allow a maximum of n internal routes per client.
--stale-routes-check n [t] : Remove routes with a last activity timestamp
                             older than n seconds. Run this check every t
                             seconds (defaults to n).
--port-share host port [dir] : When run in TCP mode, proxy incoming HTTPS
                  sessions to a web server at host:port.  dir specifies an
                  optional directory to write origin IP:port data.

Client options (when connecting to a multi-client server):
--client         : Helper option to easily configure client mode.
--auth-user-pass [up] : Authenticate with server using username/password.
                  up is a file containing username/password on 2 lines,
                  or omit to prompt from console.
--pull           : Accept certain config file options from the peer as if they
                  were part of the local config file.  Must be specified
                  when connecting to a '--mode server' remote host.
--auth-retry t  : How to handle auth failures.  Set t to
                  none (default), interact, or nointeract.
--static-challenge t e : Enable static challenge/response protocol using
                  challenge text t, with e indicating echo flag (0|1)
--server-poll-timeout n : when polling possible remote servers to connect to
                  in a round-robin fashion, spend no more than n seconds
                  waiting for a response before trying the next server.
--explicit-exit-notify [n] : On exit/restart, send exit signal to
                  server/remote. n = # of retries, default=1.

Data Channel Encryption Options (must be compatible between peers):
(These options are meaningful for both Static Key & TLS-mode)
--secret f [d]  : Enable Static Key encryption mode (non-TLS).
                  Use shared secret file f, generate with --genkey.
                  The optional d parameter controls key directionality.
                  If d is specified, use separate keys for each
                  direction, set d=0 on one side of the connection,
                  and d=1 on the other side.
--auth alg      : Authenticate packets with HMAC using message
                  digest algorithm alg (default=SHA1).
                  (usually adds 16 or 20 bytes per packet)
                  Set alg=none to disable authentication.
--cipher alg    : Encrypt packets with cipher algorithm alg
                  (default=BF-CBC).
                  Set alg=none to disable encryption.
--prng alg [nsl] : For PRNG, use digest algorithm alg, and
                   nonce_secret_len=nsl.  Set alg=none to disable PRNG.
--keysize n     : Size of cipher key in bits (optional).
                  If unspecified, defaults to cipher-specific default.
--engine [name] : Enable OpenSSL hardware crypto engine functionality.
--no-replay     : Disable replay protection.
--mute-replay-warnings : Silence the output of replay warnings to log file.
--replay-window n [t]  : Use a replay protection sliding window of size n
                         and a time window of t seconds.
                         Default n=64 t=15
--no-iv         : Disable cipher IV -- only allowed with CBC mode ciphers.
--replay-persist file : Persist replay-protection state across sessions
                  using file.
--test-crypto   : Run a self-test of crypto features enabled.
                  For debugging only.

TLS Key Negotiation Options:
(These options are meaningful only for TLS-mode)
--tls-server    : Enable TLS and assume server role during TLS handshake.
--tls-client    : Enable TLS and assume client role during TLS handshake.
--key-method m  : Data channel key exchange method.  m should be a method
                  number, such as 1 (default), 2, etc.
--ca file       : Certificate authority file in .pem format containing
                  root certificate.
--capath dir    : A directory of trusted certificates (CAs and CRLs).
--dh file       : File containing Diffie Hellman parameters
                  in .pem format (for --tls-server only).
                  Use "openssl dhparam -out dh1024.pem 1024" to generate.
--cert file     : Local certificate in .pem format -- must be signed
                  by a Certificate Authority in --ca file.
--extra-certs file : one or more PEM certs that complete the cert chain.
--key file      : Local private key in .pem format.
--pkcs12 file   : PKCS#12 file containing local private key, local certificate
                  and optionally the root CA certificate.
--verify-hash   : Specify SHA1 fingerprint for level-1 cert.
--tls-cipher l  : A list l of allowable TLS ciphers separated by : (optional).
                : Use --show-tls to see a list of supported TLS ciphers.
--tls-timeout n : Packet retransmit timeout on TLS control channel
                  if no ACK from remote within n seconds (default=2).
--reneg-bytes n : Renegotiate data chan. key after n bytes sent and recvd.
--reneg-pkts n  : Renegotiate data chan. key after n packets sent and recvd.
--reneg-sec n   : Renegotiate data chan. key after n seconds (default=3600).
--hand-window n : Data channel key exchange must finalize within n seconds
                  of handshake initiation by any peer (default=60).
--tran-window n : Transition window -- old key can live this many seconds
                  after new key renegotiation begins (default=3600).
--single-session: Allow only one session (reset state on restart).
--tls-exit      : Exit on TLS negotiation failure.
--tls-auth f [d]: Add an additional layer of authentication on top of the TLS
                  control channel to protect against DoS attacks.
                  f (required) is a shared-secret passphrase file.
                  The optional d parameter controls key directionality,
                  see --secret option for more info.
--askpass [file]: Get PEM password from controlling tty before we daemonize.
--auth-nocache  : Don't cache --askpass or --auth-user-pass passwords.
--crl-verify crl ['dir']: Check peer certificate against a CRL.
--tls-verify cmd: Run command cmd to verify the X509 name of a
                  pending TLS connection that has otherwise passed all other
                  tests of certification.  cmd should return 0 to allow
                  TLS handshake to proceed, or 1 to fail.  (cmd is
                  executed as 'cmd certificate_depth subject')
--tls-export-cert [directory] : Get peer cert in PEM format and store it
                  in an openvpn temporary file in [directory]. Peer cert is
                  stored before tls-verify script execution and deleted after.
--verify-x509-name name: Accept connections only from a host with X509 subject
                  DN name. The remote host must also pass all other tests
                  of verification.
--ns-cert-type t: Require that peer certificate was signed with an explicit
                  nsCertType designation t = 'client' | 'server'.
--x509-track x  : Save peer X509 attribute x in environment for use by
                  plugins and management interface.
--remote-cert-ku v ... : Require that the peer certificate was signed with
                  explicit key usage, you can specify more than one value.
                  value should be given in hex format.
--remote-cert-eku oid : Require that the peer certificate was signed with
                  explicit extended key usage. Extended key usage can be encoded
                  as an object identifier or OpenSSL string representation.
--remote-cert-tls t: Require that peer certificate was signed with explicit
                  key usage and extended key usage based on RFC3280 TLS rules.
                  t = 'client' | 'server'.

SSL Library information:
--show-ciphers  : Show cipher algorithms to use with --cipher option.
--show-digests  : Show message digest algorithms to use with --auth option.
--show-engines  : Show hardware crypto accelerator engines (if available).
--show-tls      : Show all TLS ciphers (TLS used only as a control channel).

Generate a random key (only for non-TLS static key encryption mode):
--genkey        : Generate a random key to be used as a shared secret,
                  for use with the --secret option.
--secret file   : Write key to file.

Tun/tap config mode (available with linux 2.4+):
--mktun         : Create a persistent tunnel.
--rmtun         : Remove a persistent tunnel.
--dev tunX|tapX : tun/tap device
--dev-type dt   : Device type.  See tunnel options above for details.
--user user     : User to set privilege to.
--group group   : Group to set privilege to.

General Standalone Options:
--show-gateway : Show info about default gateway.

OpenVPN Community Software



OpenVPN is a full-featured open source SSL VPN solution that accommodates a wide range of configurations, including remote access, site-to-site VPNs, Wi-Fi security, and enterprise-scale remote access solutions with load balancing, failover, and fine-grained access-controls. Starting with the fundamental premise that complexity is the enemy of security, OpenVPN offers a cost-effective, lightweight alternative to other VPN technologies that is well-targeted for the SME and enterprise markets.

OpenVPN combines security with ease-of-use

OpenVPN's lightweight design sheds many of the complexities that characterize other VPN implementations. The OpenVPN security model is based on SSL, the industry standard for secure communications via the internet. OpenVPN implements OSI layer 2 or 3 secure network extension using the SSL/TLS protocol, supports flexible client authentication methods based on certificates, smart cards, and/or 2-factor authentication, and allows user or group-specific access control policies using firewall rules applied to the VPN virtual interface. OpenVPN is not a web application proxy and does not operate through a web browser.
Stéphane Guérithault

In a world without walls and fences, who needs Windows and Gates

PayPal Donation: https://www.paypal.me/qoolbox

My apps

##########################################################################

rolling now for competitor, i do not support anymore Thecus apllications due to lack of time

##########################################################################


voyance - Sophrologue Hypnothérapeute Essonne 
Reply
#2
Stéphane, I am able to help you out with the configuration bit. (how you need to configure OpenVPN)

Unfortunately it's a bit hard for me to translate from the older version of GMNETOVPND to yours.
For starters your version works, I managed to get the configuration loaded.

It becomes more dificult when the whole IP routing from the module to the network comes into play.
Am willing to share my current configuration (without the details that give away information about my IP and/or SSL keys)
Reply
#3
it will be helpfull, may be you can post here or in PM a little tuto and i will add it to the header of this thread

thanks a lot,
Stéphane Guérithault

In a world without walls and fences, who needs Windows and Gates

PayPal Donation: https://www.paypal.me/qoolbox

My apps

##########################################################################

rolling now for competitor, i do not support anymore Thecus apllications due to lack of time

##########################################################################


voyance - Sophrologue Hypnothérapeute Essonne 
Reply
#4
couldn't let it go

Startup is as follows:
Code:
#!/bin/sh

PATH=/raid/data/module/OpenVPN/sys/bin:$PATH
export PATH

CFG_FILE="/raid/data/module/OpenVPN/sys/etc/openvpn/server.conf"

##
## enter your command below
##

/raid/data/module/OpenVPN/sys/bin/openvpn --config ${CFG_FILE}

# Enable IP-Forwarding
# Check if UDP Port 1194 is opened or not
if [ ! "$(netstat -anl |grep 1194 |wc -l)" = 0 ]; then
    echo "1" > /proc/sys/net/ipv4/ip_forward
fi

Shutdown is as follows:
Code:
#!/bin/sh
#start up OpenVPN script for module

PATH=/raid/data/module/OpenVPN/sys/bin:$PATH
export PATH

PID_FILE="/raid/data/module/OpenVPN/sys/var/run/openvpn-server.pid"

##
## enter your command below
##

echo "Stop OpenVPN"
{
    kill `cat ${PID_FILE}`
    rm -f ${PID_FILE}
}

# Disable IP-Forwarding
echo "0" > /proc/sys/net/ipv4/ip_forward

My config file looks like this, Routed setup. Have a static route setup on my router, which points to my nas and serves the network: 10.8.0.0
Code:
writepid /raid/data/module/OpenVPN/sys/var/run/openvpn-server.pid
#################################################
# Sample OpenVPN 2.0 config file for            #
# multi-client server.                          #
#                                               #
# This file is for the server side              #
# of a many-clients <-> one-server              #
# OpenVPN configuration.                        #
#                                               #
# OpenVPN also supports                         #
# single-machine <-> single-machine             #
# configurations (See the Examples page         #
# on the web site for more info).               #
#                                               #
# This config should work on Windows            #
# or Linux/BSD systems.  Remember on            #
# Windows to quote pathnames and use            #
# double backslashes, e.g.:                     #
# "D:\\Program Files\\OpenVPN\\config\\foo.key" #
#                                               #
# Comments are preceded with '#' or ';'         #
#################################################

# Which local IP address should OpenVPN
# listen on? (optional)
# local 192.168.1.2

# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one.  You will need to
# open up this port on your firewall.
port 1194

# TCP or UDP server?
;proto tcp
proto udp

# "dev tun" will create a routed IP tunnel,
# "dev tap" will create an ethernet tunnel.
# Use "dev tap0" if you are ethernet bridging
# and have precreated a tap0 virtual interface
# and bridged it with your ethernet interface.
# If you want to control access policies
# over the VPN, you must create firewall
# rules for the the TUN/TAP interface.
# On non-Windows systems, you can give
# an explicit unit number, such as tun0.
# On Windows, use "dev-node" for this.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun

# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel if you
# have more than one.  On XP SP2 or higher,
# you may need to selectively disable the
# Windows firewall for the TAP adapter.
# Non-Windows systems usually don't need this.
;dev-node MyTap

# SSL/TLS root certificate (ca), certificate
# (cert), and private key (key).  Each client
# and the server must have their own cert and
# key file.  The server and all clients will
# use the same ca file.
#
# See the "easy-rsa" directory for a series
# of scripts for generating RSA certificates
# and private keys.  Remember to use
# a unique Common Name for the server
# and each of the client certificates.
#
# Any X509 key management system can be used.
# OpenVPN can also use a PKCS #12 formatted key file
# (see "pkcs12" directive in man page).
ca /raid/data/module/OpenVPN/sys/etc/openvpn/keys/ca.crt
cert /raid/data/module/OpenVPN/sys/etc/openvpn/keys/server.crt
key /raid/data/module/OpenVPN/sys/etc/openvpn/keys/server.key # This file should be kept secret

# Diffie hellman parameters.
# Generate your own with:
#   openssl dhparam -out dh1024.pem 1024
# Substitute 2048 for 1024 if you are using
# 2048 bit keys.
dh /raid/data/module/OpenVPN/sys/etc/openvpn/keys/dh2048.pem

# Configure server mode and supply a VPN subnet
# for OpenVPN to draw client addresses from.
# The server will take 10.8.0.1 for itself,
# the rest will be made available to clients.
# Each client will be able to reach the server
# on 10.8.0.1. Comment this line out if you are
# ethernet bridging. See the man page for more info.
server 10.8.0.0 255.255.255.0

# Maintain a record of client <-> virtual IP address
# associations in this file.  If OpenVPN goes down or
# is restarted, reconnecting clients can be assigned
# the same virtual IP address from the pool that was
# previously assigned.
ifconfig-pool-persist /raid/data/module/OpenVPN/sys/etc/openvpn/ipp.txt

# Configure server mode for ethernet bridging.
# You must first use your OS's bridging capability
# to bridge the TAP interface with the ethernet
# NIC interface.  Then you must manually set the
# IP/netmask on the bridge interface, here we
# assume 10.8.0.4/255.255.255.0.  Finally we
# must set aside an IP range in this subnet
# (start=10.8.0.50 end=10.8.0.100) to allocate
# to connecting clients.  Leave this line commented
# out unless you are ethernet bridging.
;server-bridge 10.8.0.1 255.255.255.0 10.8.0.50 10.8.0.100

# Configure server mode for ethernet bridging
# using a DHCP-proxy, where clients talk
# to the OpenVPN server-side DHCP server
# to receive their IP address allocation
# and DNS server addresses.  You must first use
# your OS's bridging capability to bridge the TAP
# interface with the ethernet NIC interface.
# Note: this mode only works on clients (such as
# Windows), where the client-side TAP adapter is
# bound to a DHCP client.
;server-bridge

# Push routes to the client to allow it
# to reach other private subnets behind
# the server.  Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (10.8.0.0/255.255.255.0)
# back to the OpenVPN server.
push "route 192.168.1.0 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"

# To assign specific IP addresses to specific
# clients or if a connecting client has a private
# subnet behind it that should also have VPN access,
# use the subdirectory "ccd" for client-specific
# configuration files (see man page for more info).

# EXAMPLE: Suppose the client
# having the certificate common name "Thelonious"
# also has a small subnet behind his connecting
# machine, such as 192.168.40.128/255.255.255.248.
# First, uncomment out these lines:
;client-config-dir ccd
;route 192.168.40.128 255.255.255.248
;route 192.168.1.0 255.255.255.0

# Then create a file ccd/Thelonious with this line:
#   iroute 192.168.40.128 255.255.255.248
# This will allow Thelonious' private subnet to
# access the VPN.  This example will only work
# if you are routing, not bridging, i.e. you are
# using "dev tun" and "server" directives.

# EXAMPLE: Suppose you want to give
# Thelonious a fixed VPN IP address of 10.9.0.1.
# First uncomment out these lines:
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
# Then add this line to ccd/Thelonious:
#   ifconfig-push 10.9.0.1 10.9.0.2

# Suppose that you want to enable different
# firewall access policies for different groups
# of clients.  There are two methods:
# (1) Run multiple OpenVPN daemons, one for each
#     group, and firewall the TUN/TAP interface
#     for each group/daemon appropriately.
# (2) (Advanced) Create a script to dynamically
#     modify the firewall in response to access
#     from different clients.  See man
#     page for more info on learn-address script.
;learn-address ./script

# If enabled, this directive will configure
# all clients to redirect their default
# network gateway through the VPN, causing
# all IP traffic such as web browsing and
# and DNS lookups to go through the VPN
# (The OpenVPN server machine may need to NAT
# or bridge the TUN/TAP interface to the internet
# in order for this to work properly).
push "redirect-gateway def1 bypass-dhcp"

# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses.  CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
# The addresses below refer to the public
# DNS servers provided by opendns.com.
push "dhcp-option DNS 192.168.1.254"
push "dhcp-option DNS 8.8.8.8"

push "dhcp-option DOMAIN zeronrg.local"

# Uncomment this directive to allow different
# clients to be able to "see" each other.
# By default, clients will only see the server.
# To force clients to only see the server, you
# will also need to appropriately firewall the
# server's TUN/TAP interface.
;client-to-client

# Uncomment this directive if multiple clients
# might connect with the same certificate/key
# files or common names.  This is recommended
# only for testing purposes.  For production use,
# each client should have its own certificate/key
# pair.
#
# IF YOU HAVE NOT GENERATED INDIVIDUAL
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
# EACH HAVING ITS OWN UNIQUE "COMMON NAME",
# UNCOMMENT THIS LINE OUT.
;duplicate-cn

# The keepalive directive causes ping-like
# messages to be sent back and forth over
# the link so that each side knows when
# the other side has gone down.
# Ping every 10 seconds, assume that remote
# peer is down if no ping received during
# a 120 second time period.
keepalive 10 120

# For extra security beyond that provided
# by SSL/TLS, create an "HMAC firewall"
# to help block DoS attacks and UDP port flooding.
#
# Generate with:
#   openvpn --genkey --secret ta.key
#
# The server and each client must have
# a copy of this key.
# The second parameter should be '0'
# on the server and '1' on the clients.
tls-auth /raid/data/module/OpenVPN/sys/etc/openvpn/keys/ta.key 0 # This file is secret

# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
;cipher BF-CBC        # Blowfish (default)
;cipher AES-128-CBC   # AES
;cipher DES-EDE3-CBC  # Triple-DES

# Enable compression on the VPN link.
# If you enable it here, you must also
# enable it in the client config file.
comp-lzo

# The maximum number of concurrently connected
# clients we want to allow.
max-clients 20

# It's a good idea to reduce the OpenVPN
# daemon's privileges after initialization.
#
# You can uncomment this out on
# non-Windows systems.
;user nobody
;group nobody

# The persist options will try to avoid
# accessing certain resources on restart
# that may no longer be accessible because
# of the privilege downgrade.
persist-key
persist-tun

# Output a short status file showing
# current connections, truncated
# and rewritten every minute.
status /raid/data/module/log/openvpn-status.log

# By default, log messages will go to the syslog (or
# on Windows, if running as a service, they will go to
# the "\Program Files\OpenVPN\log" directory).
# Use log or log-append to override this default.
# "log" will truncate the log file on OpenVPN startup,
# while "log-append" will append to it.  Use one
# or the other (but not both).
log /raid/data/module/log/openvpn.log
;log-append  openvpn.log

# Set the appropriate level of log
# file verbosity.
#
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
verb 4

# Silence repeating messages.  At most 20
# sequential messages of the same message
# category will be output to the log.
;mute 20

daemon

Please understand that I will not discuss how to generate the keys, as you should be a bit technical to figure that out and there is no single approach.
<!-- m --><a class="postlink" href="http://openvpn.net/index.php/open-source/documentation/howto.html">http://openvpn.net/index.php/open-sourc ... howto.html</a><!-- m -->

The OpenVPN 2 Cookbook was my way to get it up and running.
Remember that I've first set it up on Windows Server 2012, when I got my N5550 moved it to the NAS with the older version. Now upgraded it to 2.3.2 using this build.

[updated the post to some more tweaking]
Reply
#5
Big Grin

thanks for the share
Stéphane Guérithault

In a world without walls and fences, who needs Windows and Gates

PayPal Donation: https://www.paypal.me/qoolbox

My apps

##########################################################################

rolling now for competitor, i do not support anymore Thecus apllications due to lack of time

##########################################################################


voyance - Sophrologue Hypnothérapeute Essonne 
Reply
#6
Big Grin

thanks for the share
Stéphane Guérithault

In a world without walls and fences, who needs Windows and Gates

PayPal Donation: https://www.paypal.me/qoolbox

My apps

##########################################################################

rolling now for competitor, i do not support anymore Thecus apllications due to lack of time

##########################################################################


voyance - Sophrologue Hypnothérapeute Essonne 
Reply
#7
Hi Stephane,

I am also playing with this module, but lack the time to really dig into it at the moment.

I have a problem which I will open a new topic for.

and could think of 3 suggestions to improve the module
- create a directory for user files (including a default dir makes it easier to reference to when making a tutorial, and also the possibility to easy backup)
- include the server.conf in the web interface
- a backup/restore of the start- and stop-script when unistalling the module, as well as backup of the "userfiles" for openVPN (like the server.conf and the keys)

@ZeroNRG, thnx for sharing, I will look into your info later this week.
Thecus N5550 (CPU: D2550 @ 1.86GHz, BIOS: CDV_T26 X64)
Disks:  4*3TB Raid5 (4 * Hitachi Ultrastar 7K3000 HUA723030ALA640)
Memory:  8GB (2*4GB Corsair CMSO8GX3M2A1333C9)
Firmware: 2.05.14.5 (with MEM=4G removed from menu.lst)
Reply
#8
Hi Stephane,

I am also playing with this module, but lack the time to really dig into it at the moment.

I have a problem which I will open a new topic for.

and could think of 3 suggestions to improve the module
- create a directory for user files (including a default dir makes it easier to reference to when making a tutorial, and also the possibility to easy backup)
- include the server.conf in the web interface
- a backup/restore of the start- and stop-script when unistalling the module, as well as backup of the "userfiles" for openVPN (like the server.conf and the keys)

@ZeroNRG, thnx for sharing, I will look into your info later this week.
Thecus N5550 (CPU: D2550 @ 1.86GHz, BIOS: CDV_T26 X64)
Disks:  4*3TB Raid5 (4 * Hitachi Ultrastar 7K3000 HUA723030ALA640)
Memory:  8GB (2*4GB Corsair CMSO8GX3M2A1333C9)
Firmware: 2.05.14.5 (with MEM=4G removed from menu.lst)
Reply
#9
thanks for your suggestion :

we can imagine such like my other module (Mysql, plex... and many other) a config directory called OPENVPN_CONFIG in /raid/data/ (/raid/data/OPENVPN_CONFIG)
this will be accessible as a simple share (if you create OPENVPN_CONFIG in the Thecus Webui)

server.conf editable shouldnt be a problem

we can imagine the user.conf and server.conf are in /raid/data/OPENVPN_CONFIG So even if you unsintall the module your file will be kept in the config directory

Smile
Stéphane Guérithault

In a world without walls and fences, who needs Windows and Gates

PayPal Donation: https://www.paypal.me/qoolbox

My apps

##########################################################################

rolling now for competitor, i do not support anymore Thecus apllications due to lack of time

##########################################################################


voyance - Sophrologue Hypnothérapeute Essonne 
Reply
#10
thanks for your suggestion :

we can imagine such like my other module (Mysql, plex... and many other) a config directory called OPENVPN_CONFIG in /raid/data/ (/raid/data/OPENVPN_CONFIG)
this will be accessible as a simple share (if you create OPENVPN_CONFIG in the Thecus Webui)

server.conf editable shouldnt be a problem

we can imagine the user.conf and server.conf are in /raid/data/OPENVPN_CONFIG So even if you unsintall the module your file will be kept in the config directory

Smile
Stéphane Guérithault

In a world without walls and fences, who needs Windows and Gates

PayPal Donation: https://www.paypal.me/qoolbox

My apps

##########################################################################

rolling now for competitor, i do not support anymore Thecus apllications due to lack of time

##########################################################################


voyance - Sophrologue Hypnothérapeute Essonne 
Reply
#11
sounds like a great solution to me!
maybe the start and stopscript can be placed there as well, because you control the entire setup of the module with those 3 files (and the key-files of course).
then you can symlink in /raid/data/module/OpenVPN/bin to the start/stopscripts in /raid/data/OPENVPN_CONFIG.

I aslo saw yesterday there will be an important update released soon because of some bug in OpenSSL:
CVE-2014-0160 / Heartbleed

Quote:The OpenVPN dev team is aware of CVE-2014-0160/Heartbleed and is actively working on a fix. First off, we have released a new Windows build, available immediately, which uses OpenSSL 1.0.1g, which is safe. Additionally, on Thursday, April 10, we will be releasing OpenVPN 2.3.3, with a number of fixes/enhancements.
Thecus N5550 (CPU: D2550 @ 1.86GHz, BIOS: CDV_T26 X64)
Disks:  4*3TB Raid5 (4 * Hitachi Ultrastar 7K3000 HUA723030ALA640)
Memory:  8GB (2*4GB Corsair CMSO8GX3M2A1333C9)
Firmware: 2.05.14.5 (with MEM=4G removed from menu.lst)
Reply
#12
yes, just been warn this morning about this issue, may be OpenVPN is impacted i have to check the openssl release,

the pathed 1.0.1g is already available on OpenSSL website

Wink
Stéphane Guérithault

In a world without walls and fences, who needs Windows and Gates

PayPal Donation: https://www.paypal.me/qoolbox

My apps

##########################################################################

rolling now for competitor, i do not support anymore Thecus apllications due to lack of time

##########################################################################


voyance - Sophrologue Hypnothérapeute Essonne 
Reply
#13
yes, just been warn this morning about this issue, may be OpenVPN is impacted i have to check the openssl release,

the pathed 1.0.1g is already available on OpenSSL website

Wink
Stéphane Guérithault

In a world without walls and fences, who needs Windows and Gates

PayPal Donation: https://www.paypal.me/qoolbox

My apps

##########################################################################

rolling now for competitor, i do not support anymore Thecus apllications due to lack of time

##########################################################################


voyance - Sophrologue Hypnothérapeute Essonne 
Reply
#14
Updated the Start & Stop sample scripts to be a bit more resilient, had some issues with the closing of the process.
Worked around with with another sample of stopping a process (Stephane, might recognize)

I'm running OpenVPN in routed modus, please see if this suits your needs:
<!-- m --><a class="postlink" href="http://openvpn.net/index.php/open-source/faq/community-software-general/309-what-is-the-difference-between-bridging-and-routing.html">http://openvpn.net/index.php/open-sourc ... uting.html</a><!-- m -->
Reply
#15
Updated the Start & Stop sample scripts to be a bit more resilient, had some issues with the closing of the process.
Worked around with with another sample of stopping a process (Stephane, might recognize)

I'm running OpenVPN in routed modus, please see if this suits your needs:
<!-- m --><a class="postlink" href="http://openvpn.net/index.php/open-source/faq/community-software-general/309-what-is-the-difference-between-bridging-and-routing.html">http://openvpn.net/index.php/open-sourc ... uting.html</a><!-- m -->
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  [OpenVPN][2.4.4.1] Client/Server VPN Solution outkastm 17 9,127 06-22-2018, 07:36 PM
Last Post: Blackbear199
  [ UrBackup ] Client/server backup system outkastm 42 21,513 02-10-2018, 03:05 AM
Last Post: outkastm
  [ Adito VPN x86 & x64 ] [ 0.9.1.0 ] OpenVPN-ALS Server Qoolbox 37 14,274 12-19-2013, 07:06 AM
Last Post: Qoolbox
  [ Adito VPN x86 & x64 ] [ 0.9.1.0 ] OpenVPN-ALS Server 0 7,618 Less than 1 minute ago
Last Post:

Forum Jump:


Users browsing this thread: 1 Guest(s)