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

📄 openvpn.8

📁 OpenVPN is a robust and highly flexible tunneling application that uses all of the encryption, authe
💻 8
📖 第 1 页 / 共 5 页
字号:
of where the client is connecting from.  Rememberthat you must also add the route to the systemrouting table as well (such as by using the.B --routedirective).  The reason why two routes are neededis that the.B --routedirective routes the packet from the systemto OpenVPN.  Once in OpenVPN, the.B --iroutedirective routes to the specific client.This option must be specified either in a clientinstance config file using.B --client-config-diror dynamically generated using a.B --client-connectscript..TP.B --client-to-clientBecause the OpenVPN server mode handles multiple clientsthrough a single tun or tap interface, it is effectivelya router.  The.B --client-to-clientflag tells OpenVPN to internally route client-to-clienttraffic rather than pushing all client-originating trafficto the tun/tap interface.When this option is used, each client will "see" the otherclients which are currently connected.  Otherwise, eachclient will only see the server.  Don't use this optionif you want to firewall tunnel traffic usingcustom, per-client rules..TP.B --duplicate-cnAllow multiple clients with the same common name to concurrently connect.In the absence of this option, OpenVPN will disconnect a client instanceupon connection of a new client having the same common name..TP.B --client-connect scriptRun.B scripton client connection.  The script is passed the common nameand IP address of the just-authenticated clientas environmental variables.  The script is also passeda single argument which is the filename of a temporary file.If the script wants to generate client-instance-specificoptions, it can write them to this file.  See the.B --client-config-diroption below for options whichcan be legally used in a client-specific context..TP.B --client-disconnectLike.B --client-connectbut called on client instance shutdown..TP.B --client-config-dir dirSpecify a directory.B dirfor custom client config files.  Aftera connecting client has been authenticated, OpenVPN willlook in this directory for a file having the same nameas the client's X509 common name.  If a matching fileexists, it will be opened and processed for client-specificconfiguration options.One of the useful properties of this option is that itallows client configuration files to be convenientlycreated, edited, or removed while the server is live,without needing to restart the server.The followingoptions are legal in a client-specific context:.B --push, --push-reset, --iroute, --ifconfig-push,and.B --config..TP.B --tmp-dir dirSpecify a directory.B dirfor temporary files.  This directory will be used by.B --client-connectscripts to dynamically generate client-specificconfiguration files..TP.B --hash-size r vSet the size of the real address hash table to.B rand the virtual address table to.B v.By default, both tables are sized at 256 buckets..TP.B --bcast-buffers nAllocate.B nbuffers for broadcast datagrams (default=256)..TP.B --connect-freq n secAllow a maximum of.B nnew connections per.B sec seconds from clients.  This is designed to contain DoS attacks which floodthe server with connection requests using certificates whichwill ultimately fail to authenticate.This is an imperfect solution however, because in a realDoS scenario, legitimate connections might also be refused..TP.B --learn-address cmdRun script or shell command.B cmdto validate client virtual addresses..B cmdwill be executed with 3 parameters:.B [1] operation --"add", "update", or "delete" based on whether or notthe address is being added to, modified, or deleted fromOpenVPN's internal routing table..br.B [2] address --The address being learned or unlearned.  This can bean IPv4 address such as "198.162.10.14", an IPv4 subnetsuch as "198.162.10.0/24", or an ethernet MAC address (when.B --dev tapis being used) such as "00:FF:01:02:03:04"..br.B [3] common name --The common name on the certificate associated with theclient linked to this address.  Only present for "add"or "update" operations, not "delete".Normally, the.B cmdscript will use the information provided above to setappropriate firewall entries on the VPN tun/tap interface.Since OpenVPN provides the association between virtual IPor MAC address and the client's authenticated common name,it allows a user-defined script to configure firewall accesspolicies with regard to the client's high-level common name,rather than the low level client virtual addresses..SS Data Channel Encryption Options:These options are meaningful for both Static & TLS-negotiated key modes(must be compatible between peers)..TP.B --secret file [direction]Enable Static Key encryption mode (non-TLS).Use pre-shared secret.B filewhich was generated with.B --genkey.The optional.B directionparameter enables the use of 4 distinct keys(HMAC-send, cipher-encrypt, HMAC-receive, cipher-decrypt), so thateach data flow direction has a different set of HMAC and cipher keys.This has a number of desirable security properties includingeliminating certain kinds of DoS and message replay attacks.When the.B directionparameter is omitted, 2 keys are used bidirectionally, one for HMACand the other for encryption/decryption.The.B directionparameter should always be complementary on either side of the connection,i.e. one side should use "0" and the other should use "1", or both sidesshould omit it altogether.The.B directionparameter requires that.B filecontains a 2048 bit key.  While pre-1.5 versions of OpenVPNgenerate 1024 bit key files, any version of OpenVPN whichsupports the.B directionparameter, will also support 2048 bit key file generationusing the.B --genkeyoption.Static key encryption mode has certain advantages,the primary being 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 secrecy features ofTLS mode (using Diffie Hellman key exchange), where even if an attackerwas able to steal your private key, he would gain no information to helphim decrypt past sessions.Another advantageous 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 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.OpenVPN's usage of HMAC is to first encrypt a packet, then HMAC the resulting ciphertext.In static-key encryption mode, the HMAC keyis included in the key file generated by.B --genkey.In TLS mode, the HMAC key is dynamically generated and sharedbetween peers via the TLS control channel.  If OpenVPN receives a packet witha bad HMAC it will drop the packet.HMAC usually adds 16 or 20 bytes per packet.Set.B alg=noneto disable authentication.For more information on HMAC see.I http://www.cs.ucsd.edu/users/mihir/papers/hmac.html.TP.B --cipher algEncrypt packets with cipher algorithm.B alg.The default is.B BF-CBC,an abbreviation for Blowfish in Cipher Block Chaining mode.Blowfish has the advantages of being fast, very secure, and allowing key sizesof up to 448 bits.  Blowfish is designed to be used in situations wherekeys are changed infrequently.For more information on blowfish, see.I http://www.counterpane.com/blowfish.htmlTo see other ciphers that are available withOpenVPN, use the.B --show-ciphersoption.OpenVPN supports the CBC, CFB, and OFB cipher modes.Set.B alg=noneto disable encryption..TP.B --keysize nSize of cipher key in bits (optional).If unspecified, defaults to cipher-specific default.  The.B --show-ciphersoption (see below) shows all available OpenSSL ciphers,their default key sizes, and whether the key size canbe changed.  Use care in changing a cipher's defaultkey size.  Many ciphers have not been extensivelycryptanalyzed with non-standard key lengths, and alarger key may offer no real guarantee of greatersecurity, or may even reduce security..TP.B --engineEnable OpenSSL hardware crypto engine functionality..TP.B --no-replayDisable OpenVPN's protection against replay attacks.Don't use this option unless you are prepared to makea tradeoff of greater efficiency in exchange for lesssecurity.OpenVPN provides datagram replay protection by default.Replay protection is accomplishedby tagging each outgoing datagram with an identifierthat is guaranteed to be unique for the key being used.The peer that receives the datagram will check forthe uniqueness of the identifier.  If the identifierwas already received in a previous datagram, OpenVPNwill drop the packet.  Replay protection is importantto defeat attacks such as a SYN flood attack, wherethe attacker listens in the wire, intercepts a TCPSYN packet (identifying it by the context in whichit occurs in relation to other packets), then floodsthe receiving peer with copies of this packet.OpenVPN's replay protection is implemented in slightlydifferent ways, depending on the key management modeyou have selected.In Static Key modeor when using an CFB or OFB mode cipher, OpenVPN uses a64 bit unique identifier that combines a time stamp withan incrementing sequence number.When using TLS mode for key exchange and a CBC ciphermode, OpenVPN uses only a 32 bit sequence number withouta time stamp, since OpenVPN can guarantee the uniquenessof this value for each key.  As in IPSec, if the sequence number isclose to wrapping back to zero, OpenVPN will triggera new key exchange.To check for replays, OpenVPN usesthe.I sliding windowalgorithm usedby IPSec..TP.B --replay-window n [t]Use a replay protection sliding-window of size.B nand a time window of.B tseconds.By default.B nis 64 (the IPSec default) and.B tis 15 seconds.This option is only relevant in UDP mode, i.e.when either.B --proto udpis specifed, or no.B --protooption is specified.When OpenVPN tunnels IP packets over UDP, there is the possibility thatpackets might be dropped or delivered out of order.  Because OpenVPN, like IPSec,is emulating the physical network layer,it will accept an out-of-order packet sequence, andwill deliver such packets in the same order they were received tothe TCP/IP protocol stack, provided they satisfy several constraints..B (a)The packet cannot be a replay (unless.B --no-replayis specified, which disables replay protection altogether)..B (b)If a packet arrives out of order, it will only be accepted if the differencebetween its sequence number and the highest sequence number receivedso far is less than.B n..B (c)If a packet arrives out of order, it will only be accepted if it arrives no laterthan.B tseconds after any packet containing a higher sequence number.If you are using a network link with a large pipeline (meaning thatthe product of bandwidth and latency is high), you may want to usea larger value for.B n.Satellite links in particular often require this.If you run OpenVPN at.B --verb 4,you will see the message "Replay-window backtrack occurred [x]"every time the maximum sequence number backtrack seen thus farincreases.  This can be used to calibrate.B n.There is some controversy on the appropriate method of handling packetreordering at the security layer.Namely, to what extent should thesecurity layer protect the encapsulated protocol from attacks which masqueradeas the kinds of normal packet loss and reordering that occur over IP networks?The IPSec and OpenVPN approach is to allow packet reordering within a certainfixed sequence number window.OpenVPN adds to the IPSec model by limiting the window size in time as well assequence space.OpenVPN also adds TCP transport as an option (not offered by IPSec) in whichcase OpenVPN can adopt a very strict attitude towards message deletion andreordering:  Don't allow it.  Since TCP guarantees reliability, any packetloss or reordering event can be assumed to be an attack.In this sense, it could be argued that TCP tunnel transport is preferred whentunneling non-IP or UDP application protocols which might be vulnerable to amessage deletion or reordering attack which falls within the normaloperational parameters of IP networks.So I would make the statement that one should never tunnel a non-IP protocolor UDP application protocol over UDP, if the protocol might be vulnerable to amessage deletion or reordering attack that falls within the normal operatingparameters of what is to be expected from the physical IP layer.  The problemis easily fixed by simply using TCP as the VPN transport layer..TP.B --replay-persist filePersist replay-protection state across sessions using.B fileto save and reload the state.This option will strengthen protection against replay attacks,especially when you are using OpenVPN in a dynamic context (suchas with.B --inetd)when OpenVPN sessions are frequently started and stopped. This option will keep a disk copy of the current replay protectionstate (i.e. the most recent packet timestamp and sequence numberreceived from the remote peer), so that if an OpenVPN sessionis stopped and restarted, it will reject any replays of packetswhich were already received by the prior session.This option only makes sense when replay protection is enabled(the default) and you are using either.B --secret(shared-secret key mode) or TLS mode with.B --tls-auth..TP.B --no-ivDisable OpenVPN's use of IV (cipher initialization vector).Don't use this option unless you are prepared to makea tradeoff of greater efficiency in exchange for lesssecurity.OpenVPN uses an IV by default, and requires it for CFB andOFB cipher modes (which are totally insecure without it).Using an IV is important for security when multiplemessages are being encrypted/decrypted with the same key.IV is implemented differently depending on the cipher mode used.In CBC mode, OpenVPN uses a pseudo-random IV for each packet.In CFB/OFB mode, OpenVPN uses a unique sequence number and time stampas the IV.  In fact, in CFB/OFB mode, OpenVPN uses a datagramspace-saving optimization that uses the unique identifier fordatagram replay protection as the IV..TP.B --test-cryptoDo a self-test of OpenVPN's crypto options by encrypting anddecrypting test packets using the data channel encryption optionsspecified above.  This option does not re

⌨️ 快捷键说明

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