--- gvpe/doc/gvpe.conf.5.pod 2008/08/10 22:18:58 1.20 +++ gvpe/doc/gvpe.conf.5.pod 2009/07/18 05:59:16 1.24 @@ -4,17 +4,21 @@ =head1 SYNOPSIS + # global options for all nodes udp-port = 407 mtu = 1492 ifname = vpn0 + # first node is named branch1 and is at 1.2.3.4 node = branch1 hostname = 1.2.3.4 + # second node uses dns to resolve the address node = branch2 hostname = www.example.net udp-port = 500 # this host uses a different udp-port + # third node has no fixed ip address node = branch3 connect = ondemand @@ -30,18 +34,21 @@ C setting and will only "execute" it on the named node, or (if the nodename starts with "!") on all nodes except the named one. - name = value +For example, set the MTU to C<1450> everywhere, loglevel to C on +branch1, and connect to C everywhere but on branch2: + + mtu = 1450 on branch1 loglevel = noise on !branch2 connect = ondemand -All settings are executed "in order", that is, later settings of the same +All settings are applied "in order", that is, later settings of the same variable overwrite earlier ones. =head1 ANATOMY OF A CONFIG FILE -Usually, a config file starts with global settings (like the udp port to -listen on), followed by node-specific sections that begin with a C line. +Usually, a config file starts with a few global settings (like the UDP +port to listen on), followed by node-specific sections that begin with a +C line. Every node that is part of the network must have a section that starts with C. The number and order of the nodes is important @@ -64,7 +71,7 @@ =item dns-forw-host = hostname/ip -The dns server to forward dns requests to for the DNS tunnel protocol +The DNS server to forward DNS requests to for the DNS tunnel protocol (default: C<127.0.0.1>, changing it is highly recommended). =item dns-forw-port = port-number @@ -80,7 +87,7 @@ help to set this to a low number (e.g. C<3> or even C<1>) to limit the number of parallel requests. -The default should be working ok for most links. +The default should be working OK for most links. =item dns-overlap-factor = float @@ -93,10 +100,10 @@ C<0.5> means that GVPE will send requests twice as often as the minimum latency measured. -For congested or picky dns forwarders you could use a value nearer to or +For congested or picky DNS forwarders you could use a value nearer to or exceeding C<1>. -The default should be working ok for most links. +The default should be working OK for most links. =item dns-send-interval = send-interval-in-seconds @@ -108,7 +115,7 @@ congested or rate-limited links, you might want to go higher, say C<0.1>, C<0.2> or even higher. -The default should be working ok for most links. +The default should be working OK for most links. =item dns-timeout-factor = float @@ -122,13 +129,13 @@ the link is very stable lower values (e.g. C<2>) might work nicely. Values near or below C<1> makes no sense whatsoever. -The default should be working ok for most links but will result in low +The default should be working OK for most links but will result in low throughput if packet loss is high. =item if-up = relative-or-absolute-path Sets the path of a script that should be called immediately after the -network interface is initialized (but not neccessarily up). The following +network interface is initialized (but not necessarily up). The following environment variables are passed to it (the values are just examples). Variables that have the same value on all nodes: @@ -177,7 +184,7 @@ The MAC address the network interface has to use. Might be used to initialize interfaces on platforms where GVPE does not -do this automatically. Please see the C manpage for +do this automatically. Please see the C man page for platform-specific information. =item NODENAME=branch1 @@ -204,8 +211,8 @@ [ $NODENAME = branch2 ] && ip addr add 10.1.0.1 dev $IFNAME ip route add 10.0.0.0/8 dev $IFNAME -More complicated examples (using routing to reduce arp traffic) can be -found in the etc/ subdirectory of the distribution. +More complicated examples (using routing to reduce ARP traffic) can be +found in the F subdirectory of the distribution. =item ifname = devname @@ -229,10 +236,10 @@ instance using the same protocol, nor can you share the protocol with other programs. -The default is 47 (GRE), which has a good chance of tunneling through -firewalls (but note that the rawip protocol is not GRE compatible). Other -common choices are 50 (IPSEC, ESP), 51 (IPSEC, AH), 4 (IPIP tunnels) or 98 -(ENCAP, rfc1241) +The default is 47 (GRE), which has a good chance of tunneling +through firewalls (but note that gvpe's rawip protocol is not GRE +compatible). Other common choices are 50 (IPSEC, ESP), 51 (IPSEC, AH), 4 +(IPIP tunnels) or 98 (ENCAP, rfc1241) =item http-proxy-host = hostname/ip @@ -245,14 +252,14 @@ requires authentication. Please note that gvpe will still try to resolve all hostnames in the -configuration file, so if you are behind a proxy without access to a dns +configuration file, so if you are behind a proxy without access to a DNS server better use numerical IP addresses. -To make best use of this option disable all protocols except tcp in your +To make best use of this option disable all protocols except TCP in your config file and make sure your routers (or all other nodes) are listening on a port that the proxy allows (443, https, is a common choice). -If you have a router, connecting to it will suffice. Otherwise tcp must be +If you have a router, connecting to it will suffice. Otherwise TCP must be enabled on all nodes. Example: @@ -268,15 +275,15 @@ =item http-proxy-auth = login:password The optional login and password used to authenticate to the proxy server, -seperated by a literal colon (C<:>). Only basic authentication is +separated by a literal colon (C<:>). Only basic authentication is currently supported. =item keepalive = seconds Sets the keepalive probe interval in seconds (default: C<60>). After this many seconds of inactivity the daemon will start to send keepalive probe -every 5 seconds until it receives a reply from the other end. If no reply -is received within 30 seconds, the peer is considered unreachable and the +every 3 seconds until it receives a reply from the other end. If no reply +is received within 15 seconds, the peer is considered unreachable and the connection is closed. =item loglevel = noise|trace|debug|info|notice|warn|error|critical @@ -288,12 +295,12 @@ Sets the maximum MTU that should be used on outgoing packets (basically the MTU of the outgoing interface) The daemon will automatically calculate -maximum overhead (e.g. udp header size, encryption blocksize...) and pass +maximum overhead (e.g. UDP header size, encryption blocksize...) and pass this information to the C script. Recommended values are 1500 (ethernet), 1492 (pppoe), 1472 (pptp). -This value must be the minimum of the mtu values of all nodes. +This value must be the minimum of the MTU values of all nodes. =item node = nickname @@ -309,7 +316,7 @@ will only ever be one such script running. In addition to all the variables passed to C scripts, the following -environment variables will be set: +environment variables will be set (values are just examples): =over 4 @@ -321,6 +328,11 @@ The node id of the remote node. +=item DESTSI=rawip/88.99.77.55:0 + +The "socket info" of the target node, protocol dependent but usually in +the format protocol/ip:port. + =item DESTIP=188.13.66.8 The numerical IP address of the remote node (gvpe accepts connections from @@ -328,17 +340,17 @@ =item DESTPORT=655 # deprecated -The UDP port used by the other side. +The protocol port used by the other side, if applicable. -=item STATE=UP +=item STATE=up -Node-up scripts get called with STATE=UP, node-down scripts get called -with STATE=DOWN. +Node-up scripts get called with STATE=up, node-change scripts get called +with STATE=change and node-down scripts get called with STATE=down. =back Here is a nontrivial example that uses nsupdate to update the name => ip -mapping in some dns zone: +mapping in some DNS zone: #!/bin/sh { @@ -347,6 +359,11 @@ echo } | nsupdate -d -k $CONFBASE:key.example.net. +=item node-change = relative-or-absolute-path + +Same as C, but gets called whenever something about a +connection changes (such as the source IP address). + =item node-down = relative-or-absolute-path Same as C, but gets called whenever a connection is lost. @@ -365,13 +382,28 @@ C puts them. Since only the private key file of the current node is used and the -private key file should be kept secret per-node to avoid spoofings, it is +private key file should be kept secret per-node to avoid spoofing, it is not recommended to use this feature. =item rekey = seconds Sets the rekeying interval in seconds (default: C<3600>). Connections are -reestablished every C seconds. +reestablished every C seconds, making them use a new encryption +key. + +=item nfmark = integer + +This advanced option, when set to a nonzero value (default: C<0>), tries +to set the netfilter mark (or fwmark) value on all sockets gvpe uses to +send packets. + +This can be used to make gvpe use a different set of routing rules. For +example, on GNU/Linux, the C could set C to 1000 and then +put all routing rules into table C<99> and then use an ip rule to make +gvpe traffic avoid that routing table, in effect routing normal traffic +via gvpe and gvpe traffic via the normal system routing tables: + + ip rule add not fwmark 1000 lookup 99 =back @@ -392,7 +424,7 @@ Wether to compress data packets sent to this node (default: C). Compression is really cheap even on slow computers and has no size -overhead at all, so enabling this is a good idea. +overhead at all, so enabling this is often a good idea. =item connect = ondemand | never | always | disabled @@ -415,13 +447,13 @@ Sometimes, a node cannot reach some other nodes for reasons of network connectivity. For example, a node behind a firewall that only allows -conenctions to/from a single other node in the network. In this case one +connections to/from a single other node in the network. In this case one should specify C and C (the other node I be a router for this to work). -The algorithm to check wether a connection may be direct is as follows: +The algorithm to check whether a connection may be direct is as follows: -1. Other node mentioned in a C? If yes, allow the connection. +1. Other node mentioned in an C? If yes, allow the connection. 2. Other node mentioned in a C? If yes, deny direct connections. @@ -471,7 +503,7 @@ See gvpe.protocol(7) for a description of the ICMP transport protocol. -Enable the ICMP transport using icmp packets of type C on this +Enable the ICMP transport using ICMP packets of type C on this node. =item enable-rawip = yes|true|on | no|false|off @@ -497,25 +529,28 @@ unless no other protocol is enabled for a node, in which case this protocol is enabled automatically). -NOTE: Please specify C if you want t use it even though +NOTE: Please specify C if you want to use it even though it might get switched on automatically, as some future version might default to another default protocol. =item hostname = hostname | ip [can not be defaulted] -Forces the address of this node to be set to the given dns hostname or ip +Forces the address of this node to be set to the given DNS hostname or IP address. It will be resolved before each connect request, so dyndns should work fine. If this setting is not specified and a router is available, then the router will be queried for the address of this node. Otherwise, the connection attempt will fail. +Note that DNS resolving is done synchronously, pausing the daemon. If that +is an issue you need to specify IP addresses. + =item icmp-type = integer Sets the type value to be used for outgoing (and incoming) packets sent via the ICMP transport. The default is C<0> (which is C, also known as -"ping-replies"). Other useful values include C<8> (C, a.k.a. +"ping-reply"). Other useful values include C<8> (C, a.k.a. "ping") and C<11> (C), but any 8-bit value can be used. =item if-up-data = value @@ -534,7 +569,7 @@ The maximum interval in seconds (default: C<3600>, one hour) between retries to establish a connection to this node. When a connection cannot -be established, gvpe uses exponential backoff capped at this value. It's +be established, gvpe uses exponential back-off capped at this value. It's sometimes useful to set this to a much lower value (e.g. C<120>) on connections to routers that usually are stable but sometimes are down, to assure quick reconnections even after longer downtimes. @@ -598,23 +633,23 @@ =over 4 -=item X +=item gvpe.conf The config file. -=item X +=item if-up The if-up script -=item X, X +=item node-up, node-down If used the node up or node-down scripts. -=item X +=item hostkey The private key (taken from C) of the current host. -=item X +=item pubkey/nodename The public keys of the other nodes, one file per node.