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

📄 openvpn.8

📁 OpenVPN is a robust and highly flexible tunneling application that uses all of the encryption, authe
💻 8
📖 第 1 页 / 共 5 页
字号:
.TP.B --tun-mtu nTake the TUN device MTU to be.B nand derive the link MTUfrom it (default=1500 for TAP devices).See.B --link-mtuabove more more information on MTU..TP.B --tun-mtu-extra nAssume that the TUN/TAP device might return as many as.B nbytes more than the.B --tun-mtusize on read.  This parameter defaults to 0, which is sufficient formost TUN devices.  TAP devices may introduce additional overhead in excessof the MTU size, and a setting of 32 is the default when TAP devices are used.This parameter only controls internal OpenVPN buffer sizing,so there is no transmission overhead associated with using a larger value..TP.B --mtu-disc typeShould we do Path MTU discovery on TCP/UDP channel?  Only supported on OSes suchas Linux that supports the necessary system call to set..B 'no'-- Never send DF (Don't Fragment) frames.br.B 'maybe'-- Use per-route hints.br.B 'yes'-- Always DF (Don't Fragment).br.TP.B --mtu-testTo empirically measure MTU on connection startup,add the.B --mtu-testoption to your configuration.OpenVPN will send ping packets of various sizesto the remote peer and measure the largest packetswhich were successfully received.  The.B --mtu-testprocess normally takes about 3 minutes to complete..TP.B --fragment maxEnable internal datagram fragmentation sothat no UDP datagrams are sent whichare larger than.B maxbytes.The.B maxparameter is interpreted in the same way as the.B --link-mtuparameter, i.e. the UDP packet size after encapsulationoverhead has been added in, but not includingthe UDP header itself.The.B --fragmentoption only makes sense when you are using the UDP protocolfor OpenVPN peer-to-peer communication, i.e..B --proto udp..B --fragmentadds 4 bytes of overhead per datagram.See the.B --mssfixoption below for an important companion option to.B --fragment.It should also be noted that this option is not meant to replaceUDP fragmentation at the IP stack level.  It is only meant as alast resort when path MTU discovery is broken.  Using this optionis less efficient than fixing path MTU discovery for your IP link andusing native IP fragmentation instead.Having said that, there are circumstances where using OpenVPN'sinternal fragmentation capability may be your only option, suchas tunneling a UDP multicast stream which requires fragmentation..TP.B --mssfix maxAnnounce to TCP sessions running over the tunnel that they should limittheir send packet sizes such that after OpenVPN has encapsulated them,the resulting UDP packet size that OpenVPN sends to its peer will notexceed.B maxbytes.The.B maxparameter is interpreted in the same way as the.B --link-mtuparameter, i.e. the UDP packet size after encapsulationoverhead has been added in, but not includingthe UDP header itself.The.B --mssfixoption only makes sense when you are using the UDP protocolfor OpenVPN peer-to-peer communication, i.e..B --proto udp..B --mssfixand.B --fragmentcan be ideally used together, where.B --mssfixwill try to keep TCP from needingpacket fragmentation in the first place,and if big packets come through anyhow(from protocols other than TCP),.B --fragmentwill internally fragment them.Both.B --fragmentand.B --mssfixare designed to work around cases where Path MTU discoveryis broken on the network path between OpenVPN peers.The usual symptom of such a breakdown is an OpenVPNconnection which successfully starts, but then stallsduring active usage.If.B --fragmentand.B --mssfixare used together,.B --mssfixwill take its default.B maxparameter from the.B --fragment maxoption.Therefore, one could lower the maximum UDP packet sizeto 1300 (a good first try for solving MTU-relatedconnection problems) with the following options:.B --tun-mtu 1500 --fragment 1300 --mssfix.TP.B --sndbuf sizeSet the TCP/UDP socket send buffer size.Currently defaults to 65536 bytes..TP.B --rcvbuf sizeSet the TCP/UDP socket receive buffer size.Currently defaults to 65536 bytes..TP.B --txqueuelen n(Linux only) Set the TX queue length on the tun/tap interface.Currently defaults to 100..TP.B --shaper nLimit bandwidth of outgoing tunnel data to.B nbytes per second on the TCP/UDP port.If you want to limit the bandwidthin both directions, use this option on both peers.OpenVPN uses the following algorithm to implementtraffic shaping: Given a shaper rate of.I nbytes per second, after a datagram write of.I bbytes is queued on the TCP/UDP port, wait a minimum of.I (b / n)seconds before queuing the next write.It should be noted that OpenVPN supports multipletunnels between the same two peers, allowing youto construct full-speed and reduced bandwidth tunnelsat the same time,routing low-priority data such as off-site backupsover the reduced bandwidth tunnel, and other dataover the full-speed tunnel.Also note that for low bandwidth tunnels(under 1000 bytes per second), you should probablyuse lower MTU values as well (see above), otherwisethe packet latency will grow so large as to triggertimeouts in the TLS layer and TCP connections runningover the tunnel.OpenVPN allows.B nto be between 100 bytes/sec and 100 Mbytes/sec..TP.B --inactive nCauses OpenVPN to exit after.B nseconds of inactivity on the TUN/TAP device.  The time lengthof inactivity is measured since the last incoming tunnel packet..TP.B --ping nPing remote over the TCP/UDP control channelif no packets have been sent for at least.B nseconds (specify.B --pingon both peers to cause ping packets to be sent in both directions sinceOpenVPN ping packets are not echoed like IP ping packets).When used in one of OpenVPN's secure modes (where.B --secret, --tls-server,or.B --tls-clientis specified), the ping packetwill be cryptographically secure.This option has two intended uses:(1) Compatibilitywith stateful firewalls.  The periodic ping will ensure thata stateful firewall rule which allows OpenVPN UDP packets topass will not time out.(2) To provide a basis for the remote to test the existenceof its peer using the.B --ping-exitoption..TP.B --ping-exit nCauses OpenVPN to exit after.B nseconds pass without reception of a pingor other packet from remote.This option can be combined with.B --inactive, --ping,and.B --ping-exitto create a two-tiered inactivity disconnect.For example,.B openvpn [options...] --inactive 3600 --ping 10 --ping-exit 60when used on both peers will cause OpenVPN to exit within 60seconds if its peer disconnects, but will exit after onehour if no actual tunnel data is exchanged..TP.B --ping-restart nSimilar to.B --ping-exit,but trigger a.B SIGUSR1restart after.B nseconds pass without reception of a pingor other packet from remote.This option is useful in caseswhere the remote peer has a dynamic IP address anda low-TTL DNS name is used to track the IP address usinga service such as.I http://dyndns.org/+ a dynamic DNS client suchas.B ddclient.If the peer cannot be reached, a restart will be triggered, causingthe hostname used with.B --remoteto be re-resolved (if.B --resolv-retryis also specified).See the signals section below for more informationon.B SIGUSR1.Note that the behavior of.B SIGUSR1can be modified by the.B --persist-tun, --persist-key, --persist-local-ip,and.B --persist-remote-ipoptions.Also note that.B --ping-exitand.B --ping-restartare mutually exclusive and cannot be used together..TP.B --ping-timer-remRun 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).  The up script is useful for specifying routecommands which route IP traffic destined forprivate subnets which exist at the otherend of the VPN connection into the tunnel.For.B --dev tunexecute as:.B cmd tun_dev tun_mtu link_mtu ifconfig_local_ip ifconfig_remote_ip [ init | restart ]For.B --dev tapexecute as:.B cmd tap_dev tap_mtu link_mtu ifconfig_local_ip ifconfig_netmask [ init | restart ]See the "Environmental Variables" section below foradditional parameters passed as environmental variables.Note 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 shell.Typically,.B cmdwill run a script to add routes to the tunnel.Normally the up script is called after the TUN/TAP device is opened.In this context, the last command line parameter passed to the scriptwill be.I init.If the.B --up-restartoption is also used, the up script will be called for restarts aswell.  A restart is considered to be a partial reinitializationof OpenVPN where the TUN/TAP instance is preserved (the.B --persist-tunoption will enable such preservation).  A restartcan be generated by a SIGUSR1 signal, a.B --ping-restarttimeout, or a connection reset when the TCP protocol is enabledwith the.B --protooption.  If a restart occurs, and.B --up-restarthas been specified, the up script will be called with.I restartas the last parameter.The following standalone example shows how the.B --upscript can be called in both an initialization and restart context.(NOTE: for security reasons, don't run the following example unless UDP port9999 is blocked by your firewall.  Also, the example will run indefinitely,so you should abort with control-c)..B openvpn --dev tun --port 9999 --verb 4 --ping-restart 10 --up 'echo up' --down 'echo down' --persist-tun --up-restartNote 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 --ifconfig

⌨️ 快捷键说明

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