⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 openvpn.8

📁 OpenVPN -- A Secure tunneling daemon
💻 8
📖 第 1 页 / 共 5 页
字号:
Run the.B --ping-exit/.B --ping-restarttimer only if we have a remote address.  Use this option if you arestarting the daemon in listen mode (i.e. without an explicit.B --remotepeer), and you don't want to start clocking timeouts until a remotepeer connects..TP.B --persist-tunDon't close and reopen TUN/TAP device or run up/down scriptsacross.B SIGUSR1or.B --ping-restartrestarts..B SIGUSR1is a restart signal similar to.B SIGHUP,but which offers finer-grained control overreset options..TP.B --persist-keyDon't re-read key files across.B SIGUSR1or.B --ping-restart.This option can be combined with.B --user nobodyto allow restarts triggered by the.B SIGUSR1signal.Normally if you drop root privileges in OpenVPN,the daemon cannot be restarted since it will now be unable to re-read protectedkey files.This option solves the problem by persisting keys across.B SIGUSR1resets, so they don't need to be re-read..TP.B --persist-local-ipPreserve initially resolved local IP address and port numberacross.B SIGUSR1or.B --ping-restartrestarts..TP.B --persist-remote-ipPreserve most recently authenticated remote IP address and port numberacross.B SIGUSR1or.B --ping-restartrestarts..TP.B --mlockDisable paging by calling the POSIX mlockall function.Requires that OpenVPN be initially run as root (thoughOpenVPN can subsequently downgrade its UID using the.B --useroption).Using this option ensures that key material and tunneldata are never written to disk due to virtualmemory paging operations which occur under mostmodern operating systems.  It ensures that even if anattacker was able to crack the box running OpenVPN, hewould not be able to scan the system swap file torecover previously usedephemeral keys, which are used for a period of timegoverned by the.B --renegoptions (see below), then are discarded.The downsideof using.B --mlockis that it will reduce the amount of physicalmemory available to other applications..TP.B --up cmdShell command to run after successful TUN/TAP device open(pre.B --userUID change).Execute as:.B cmd tun_tap_dev tun_mtu udp_mtu ifconfig_local_ip ifconfig_remote_ipNote that.B cmdcan be a shell command with multiple arguments, in whichcase all OpenVPN-generated arguments will be appendedto.B cmdto build a command line which will be passed to the script.Typically,.B cmdwill run a script such as:.B ifconfig $1 10.4.0.1 pointopoint 10.4.0.2 mtu $2(Note: remove "pointopoint" from command line on OpenBSD).Note that OpenVPN also provides the.B --ifconfigoption to automatically ifconfig the TUN device,eliminating the need to define an.B --upscript, unless you also want to configure routesin the.B --upscript.If.B --ifconfigis also specified, OpenVPN will pass the ifconfig localand remote endpoints on the command line to the.B --upscript so that they can be used to configure routes such as:.B route add -net 10.0.0.0 netmask 255.255.255.0 gw $5.TP.B --down cmdShell command to run after TUN/TAP device close(post.B --userUID change and/or.B --chroot).  Called with the same parameters as the.B --upoption above..TP.B --user userChange the user ID of the OpenVPN process to.B userafter initialization, dropping privileges in the process.This option is useful to protect the systemin the event that some hostile party was able to gain control ofan OpenVPN session.  Though OpenVPN's security features makethis unlikely, it is provided as a second line of defense.By setting.B userto.I nobodyor somebody similarly unprivileged, the hostile party would belimited in what damage they could cause.  Of course onceyou take away privileges, you cannot return themto an OpenVPN session.  This means, for example, that ifyou want to reset an OpenVPN daemon with a.B SIGUSR1signal(for example in responseto a DHCP reset), you should make use of one or more of the.B --persistoptions to ensure that OpenVPN doesn't need to execute any privilegedoperations in order to restart (such as re-reading key filesor running.BR ifconfigon the TUN device)..TP.B --group groupSimilar to the.B --useroption,this option changes the group ID of the OpenVPN process to.B groupafter initialization..TP.B --cd dirChange directory to.B dirprior to reading any files such asconfiguration files, key files, scripts, etc..B dirshould be an absolute path, with a leading "/",and without any referencesto the current directory such as "." or "..".This option is useful when you are runningOpenVPN in .B --daemonmode, and you want to consolidate all ofyour OpenVPN control files in one location..TP.B --chroot dirChroot to.B dirafter initialization.  .B --chrootessentially redefines.B diras being the toplevel directory tree (/).  OpenVPN will thereforebe unable to access any files outside this tree.This can be desirable from a security standpoint.Since the chroot operation is delayed until afterinitialization, most OpenVPN options that referencefiles will operate in a pre-chroot context.In many cases, the.B dirparameter can point to an empty directory, howevercomplications can result when scripts or restartsare executed after the chroot operation..TP.B --daemon [progname]Become a daemon after all initialization functions are completed.This option will cause all message and error output tobe sent to the syslog file (such as /var/log/messages),except for the output of shell scripts andifconfig commands,which will go to /dev/null unless otherwise redirected.The optional.B prognameparameter will cause OpenVPN to report its program nameto the system logger as.B progname.This can be useful in linking OpenVPN messagesin the syslog file with specific tunnels.When unspecified,.B prognamedefaults to "openvpn".When openvpn is run with the.B --daemonoption, it will try to delay daemonization until the majority of initializationfunctions which are capable of generating fatal errors are complete.  This meansthat initialization scripts can test the return status of theopenvpn command for a fairly reliable indication of whether the commandhas correctly initialized and entered the packet forwarding event loop.In OpenVPN, the vast majority of errors which occur after initialization are non-fatal..TP.B --passtosSet the TOS field of the tunnel packet to what the payload's TOS is..TP.B --inetd [progname]Use this option when OpenVPN is being run from the inetd or.BR xinetd(8)server.This option precludes the use of.B --daemon, --local,or.B --remote.Note that this option causes message and error output to be handled in the sameway as the.B --daemonoption.  The optional.B prognameparameter is also handled exactly as in.B --daemon.Also note that each OpenVPN tunnel requires a separate UDP port anda separate inetd or xinetd entry.  See the OpenVPN HOWTO for an exampleon using OpenVPN with xinetd:.I http://openvpn.sourceforge.net/howto.html.TP.B --writepid fileWrite OpenVPN's main process ID to.B file..TP.B --nice nChange process priority after initialization(.B ngreater than 0 is lower priority,.B nless than zero is higher priority)..TP.B --nice-work nChange priority of background TLS work thread.  The TLS threadfeature is enabled when OpenVPN is builtwith pthread support, and you are running OpenVPNin TLS mode (i.e. with.B --tls-clientor.B --tls-serverspecified).Using a TLS thread offloads the CPU-intensive process of SSL/TLS-basedkey exchange to a background thread so that it does not becomea latency bottleneck in the tunnel packet forwarding process.The parameter.B nis interpreted exactly as with the.B --niceoption above, but in relation to the work thread ratherthan the main thread..TP.B --verb nSet output verbosity to.B n(default=1).  Each level shows all info from the previous levels.Level 3 is recommended if you want a good summaryof what's happening without being swamped by output..B 0 --no output except fatal errors.br.B 1 --show startup information + connection initiated messages + non-fatal encryption & net errors.br.B 2 --show SSL/TLS negotiations.br.B 3 --show extra SSL/TLS info +.B --gremlinnet outages + adaptive compression state changes (on or off).br.B 4 --show all parameter settings.br.B 5 to 11 --show debug info of increasing verbosity (see errlevel.h for additionalinformation on debug levels).TP.B --mute nLog at most.B nconsecutive messages in the same category.  This is useful tolimit repetitive logging of similar message types..TP.B --gremlinSimulate dropped & corrupted packets + network outages(for debugging and testing only).  This is apowerful tool for verifying the robustness of the OpenVPN protocol,especially in TLS mode.  When used with TLS parameters that forcefrequent key renegotiations such as.B --reneg-sec 10,this option will stress-test the ability of OpenVPN peers to recoverfrom errors and remain in sync.Current parameter settings will cause.B --gremlinto drop 2% of packets and corrupt another 2%.  A packet corruption willalter a random byte in the packet to a random value.  It mightalso increase or decrease the size of the packet by one byte..B --gremlinwill also simulate network outages by going "down"for a period of 10 to 60 seconds.Between simulated outages, OpenVPN willremain up for periods of 10 to 300 seconds.  To see gremlinmessages, set.B --verbto 3 or higher.  To change gremlin constants, consult thefile gremlin.c included in the OpenVPN source distribution..TP.B --comp-lzoUse fast LZO compression -- may add up to 1 byte perpacket for incompressible data..TP.B --comp-noadaptWhen used in conjunction with.B --comp-lzo,this option will disable OpenVPN's adaptive compression algorithm.Normally, adaptive compression is enabled with.B --comp-lzo.Adaptive compression tries to optimize the case where you havecompression enabled, but you are sending predominantly uncompressible(or pre-compressed) packets over the tunnel, such as an FTP or rsync transferof a large, compressed file.  With adaptive compression,OpenVPN will periodically sample the compression process to measure itsefficiency.  If the data being sent over the tunnel is already compressed,the compression efficiency will be very low, triggering openvpn to disablecompression for a period of time until the next re-sample test..B .SS Data Channel Encryption Options:These options are meaningful for both Static & TLS-negotiated key modes(must be compatible between peers)..TP.B --secret fileEnable Static Key encryption mode (non-TLS).Use pre-shared secret file which was generated with.B --genkey.Static key encryption mode has certain advantages, the biggestprobably being the ease of configuration.  There are no certificatesor certificate authorities or complicated negotiation handshakes and protocols.The only requirement is that you have a pre-existing secure channel withyour peer (such as.B ssh) to initially copy the key.  This requirement, along with thefact that your key never changes unless you manually generate a new one,makes it somewhat less secure than TLS mode (see below).  If an attackermanages to steal your key, everything that was ever encrypted withit is compromised.  Contrast that to the perfect forward security features ofTLS mode where even if an attacker was able to steal your private key,he would gain no information to help him decrypt past sessions.One interesting aspect of Static Key encryption mode is thatit is a handshake-free protocol without any distinguishing signature or feature(such as a header or protocol handshake sequence) that would mark the ciphertext packets as beinggenerated by OpenVPN.  Anyone eavesdropping on the wirewould see nothingbut random-looking data..TP.B --auth algAuthenticate packets with an HMAC using messagedigest algorithm.B alg.(The default is.B SHA1).HMAC is a commonly used message authentication algorithm (MAC) that usesa data string, a secure hash algorithm, and a key, to producea digital signature.  HMAC has the property that it is infeasible

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -