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

📄 openvpn.8

📁 OpenVPN is a robust and highly flexible tunneling application that uses all of the encryption, authe
💻 8
📖 第 1 页 / 共 5 页
字号:
.B --socks-proxy server [port]Connect to remote host through a Socks5 proxy at address.B serverand port.B port(default=1080)..TP.B --socks-proxy-retryRetry indefinitely on Socks proxy errors.  If a Socks proxy erroroccurs, simulate a SIGUSR1 reset..TP.B --resolv-retry nIf hostname resolve fails for.B --remote,retry resolve for.B nseconds before failing (disabled by default).Set.B nto "infinite" to retry indefinitely..TP.B --floatAllow remote peer to change its IP address and/or port number, such as due toDHCP (this is the default if.B --remoteis not used)..B --floatwhen specified with.B --remoteallows an OpenVPN session to initially connect to a peerat a known address, however if packets arrive from a newaddress and pass all authentication tests, the new addresswill take control of the session.  This is useful whenyou are connecting to a peer which holds a dynamic addresssuch as a dial-in user or DHCP client.Essentially,.B --floattells OpenVPN to accept authenticated packetsfrom any address, not only the address which was specified in the.B --remoteoption..TP.B --ipchange cmdExecute shell command.B cmdwhen our remote ip-address is initially authenticated orchanges.Execute as:.B cmd ip_address port_numberSee 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 script.If you are running in a dynamic IP address environment wherethe IP addresses of either peer could change without notice,you can use this script, for example, to edit the.I /etc/hostsfile with the current address of the peer.  The script willbe run every time the remote peer changes its IP address.Similarly if.I ourIP address changes due to DHCP, we should configureour IP address change script (see man page for.BR dhcpcd (8)) to deliver a.B SIGHUPor.B SIGUSR1signal to OpenVPN.  OpenVPN will thenreestablish a connection with its most recently authenticatedpeer on its new IP address..TP.B --port portTCP/UDP port number for both local and remote..TP.B --lport portTCP/UDP port number for local (default=5000)..TP.B --rport portTCP/UDP port number for remote (default=5000)..TP.B --nobindDo not bind to local address and port.  The IP stack will allocatea dynamic port for returning packets.  Since the value of the dynamic portcould not be known in advance by a peer, this option is only suitable forpeers which will be initiating connections by using the.B --remoteoption..TP.B --dev tunX | tapX | nullTUN/TAP virtual network device (.B Xcan be omitted for a dynamic device.)See examples section belowfor an example on setting up a TUN device.You must use either tun devices on both ends of the connectionor tap devices on both ends.  You cannot mix them, as theyrepresent different underlying protocols..B tundevices encapsulate IPv4 while.B tapdevices encapsulate ethernet 802.3..TP.B --dev-type device-typeWhich device type are we using?.B device-typeshould be.B tunor.B tap.Use this option only if the TUN/TAP device used with.B --devdoes not begin with.B tunor.B tap..TP.B --tun-ipv6Build a tun link capable of forwarding IPv6 traffic.Should be used in conjunction with.B --dev tunor.B --dev tunX.A warning will be displayedif no specific IPv6 TUN support for your OS has been compiled into OpenVPN..TP.B --dev-node nodeExplicitly set the device node rather than using/dev/net/tun, /dev/tun, /dev/tap, etc.  If OpenVPNcannot figure out whether.B nodeis a TUN or TAP device based on the name, you shouldalso specify.B --dev-type tunor.B --dev-type tap.On Windows systems, select the TAP-Win32 adapter whichis named.B nodein the Network Connections Control Panel or theraw GUID of the adapter enclosed by braces.The.B --show-adaptersoption under Windows can also be usedto enumerate all available TAP-Win32adapters and will show both the networkconnections control panel name and the GUID foreach TAP-Win32 adapter..TP.B --ifconfig l rnSet TUN/TAP adapter parameters. .B lis the IP address of the local VPN endpoint.For TUN devices,.B rnis the IP address of the remote VPN endpoint.For TAP devices,.B rnis the subnet mask of the virtual ethernet segmentwhich is being created or connected to.For TUN devices, which facilitate virtualpoint-to-point IP connections,the proper usage of.B --ifconfigis to use two private IP addresseswhich are not a member of anyexisting subnet which is in use.The IP addresses may be consecutiveand should have their order reversedon the remote peer.  After the VPNis established, by pinging.B rn,you will be pinging across the VPN.For TAP devices, which providethe ability to create virtualethernet segments,.B --ifconfigis used to set an IP address andsubnet mask just as a physicalethernet adapter would besimilarly configured.  If you areattempting to connect to a remoteethernet bridge, the IP addressand subnet should be set to valueswhich would be valid on thethe bridged ethernet segment (notealso that DHCP can be used for thesame purpose).This option, while primarily a proxy for the.BR ifconfig (8)command, is designed to simplify TUN/TAPtunnel configuration by providing astandard interface to the differentifconfig implementations on differentplatforms..B --ifconfigparameters which are IP addresses canalso be specified as a DNS or /etc/hostsfile resolvable name.For TAP devices,.B --ifconfigshould not be used if the TAP interface will begetting an IP address lease from a DHCPserver..TP.B --ifconfig-noexecDon't actually execute ifconfig/netsh commands, insteadpass.B --ifconfigparameters to scripts using environmental variables..TP.B --ifconfig-nowarnDon't output an options consistency check warningif the.B --ifconfigoption on this side of theconnection doesn't match the remote side.  This is usefulwhen you want to retain the overall benefits of theoptions consistency check (also see.B --disable-occoption) while only disabling the ifconfig component ofthe check.For example,if you have a configuration where the local host uses.B --ifconfigbut the remote host does not, use.B --ifconfig-nowarnon the local host..TP.B --route network [netmask] [gateway] [metric]Add route to routing table after connection is established.Multiple routes can be specified.  Routes will beautomatically torn down in reverse order prior totun/tap device close.This option is intended asa convenience proxy for the.BR route (8)shell command,while at the same time providing portable semanticsacross OpenVPN's platform space..B netmaskdefault -- 255.255.255.255.B gatewaydefault -- taken from.B --route-gatewayor the second parameter to.B --ifconfigwhen.B --dev tunis specified.The default can be specified by leaving an option blank or settingit to "default".The.B networkand.B gatewayparameters canalso be specified as a DNS or /etc/hostsfile resolvable name, or as one of three special keywords:.B vpn_gateway-- The remote VPN endpoint address(derived either from.B --route-gatewayor the second parameter to.B --ifconfigwhen.B --dev tunis specified)..B net_gateway-- The pre-existing IP default gateway, read from the routingtable (Linux and Windows only)..B remote_host-- The.B --remoteaddress, or the address of a connecting client if OpenVPNis being run in server mode..TP.B --route-gateway gwSpecify a default gateway.B gwfor use with.B --route..TP.B --route-delay [n]Delay.B nseconds (default=0) after connectionestablishment, before adding routes. If.B nis 0, routes will be added immediately upon connectionestablishment.  If.B --route-delayis omitted, routes will be added immediately after tun/tap deviceopen and.B --upscript execution, before any.B --useror .B --groupprivilege downgrade (or.B --chrootexecution.)This option is designed to be useful in scenarios where DHCP isused to settap adapter addresses.  The delay will give the DHCP handshaketime to complete before routes are added.A better solution would be to poll the virtual adapter, waitingfor its IP address to become defined, but unfortunately thereis no platform independent mechanism for doing this..TP.B --route-up cmdExecute shell command.B cmdafter routes are added, subject to.B --route-delay.See the "Environmental Variables" section below foradditional parameters passed as environmental variables.Note that.B cmdcan be a shell command with multiple arguments..TP.B --route-noexecDon't add or remove routes automatically.  Instead pass routes to.B --route-upscript using environmental variables..TP.B --redirect-gateway ['local'](Experimental) Automatically execute routing commands to cause all outgoing IP trafficto be redirected over the VPN.  Currently implemented only on Linux and Windows.This option performs three steps:.B (1)Create a static route for the.B --remoteaddress which forwards to the pre-existing default gateway.This is done so that.B (3)will not create a routing loop..B (2)Delete the default gateway route..B (3)Set the new default gateway to be the VPN endpoint address (derived either from.B --route-gatewayor the second parameter to.B --ifconfigwhen.B --dev tunis specified).Add.B localflag if both OpenVPN servers are directly connected via a common subnet,such as with wireless.  The.B localflag will cause step.B 1above to be omitted.When the tunnel is torn down, all of the above steps are reversed sothat the original default route is restored..TP.B --link-mtu nTake the link device MTU to be n and derive the TUN MTUfrom it (default=1300 for TUN devices).  Thedefault is a conservativevalue that was chosenbecause it has a higher probability of working correctly.However, for manycases, using a value of 1472 will maximize performance for TUN devicesover IPv4.Fundamentally,.B --link-mtusets an upper bound on the size of UDP packets which are sentbetween OpenVPN peers.Prior to OpenVPN 1.5, this option was named.B --udp-mtu.While deprecated, this name will still be supportedfor compatibility.The MTU (Maximum Transmission Units) isthe maximum datagram size in bytes that can be sent unfragmentedover a particular network path.  OpenVPN requires that packetson the control or data channels be sent unfragmented.Typically, the link MTU should be set to a value between 1300 and 1500.The optimal size for link MTU is the largestMTU that can be handled by every router on the link path.The link MTU value should be equal on both peers.MTU problems often manifest themselves as connections whichhang during periods of active usage.  The.B --fragmentand.B --mssfixoptions are provided as workarounds to such problems.When using either of these options, it's best toset.B --tun-mtuto 1500.OpenVPNadds a small amount of overhead to each tunnel packet beforeit is forwarded from the TUN device over the secure link channel.This overhead consists of data fields such as the HMAC signature,packet ID, encryption block padding, etc.  Because of this overhead,the TUN device MTU should be slightly smaller than the link deviceMTU to make room for the extra bytes which OpenVPN adds to everydata channel packet.  OpenVPN allows you to explicitly specify eitherthe TUN MTU or the link MTU (but not both).  OpenVPN will thencompute the value you didn't specify based on the value you did.OpenVPN will compute exactly how much overhead it will need to addto each packet, based on the other options you specify.  If youspecify an.B --upscript, OpenVPN will pass the TUN MTU and link MTU values on the command lineto the script.

⌨️ 快捷键说明

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