badvpn-client.8 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. .TH badvpn-client 8 "6 October 2010"
  2. .SH NAME
  3. badvpn-client \- VPN node daemon for the BadVPN peer-to-peer VPN system
  4. .SH SYNOPSIS
  5. .B badvpn-client
  6. .RS
  7. .RB "[" --help "]"
  8. .br
  9. .RB "[" --version "]"
  10. .br
  11. .RB "[" --logger " <stdout/syslog>]"
  12. .br
  13. (logger=syslog?
  14. .br
  15. .RS
  16. .br
  17. .RB "[" --syslog-facility " <string>]"
  18. .br
  19. .RB "[" --syslog-ident " <string>]"
  20. .br
  21. .RE
  22. )
  23. .br
  24. .RB "[" --loglevel " <0-5/none/error/warning/notice/info/debug>]"
  25. .br
  26. .RB "[" --channel-loglevel " <channel-name> <0-5/none/error/warning/notice/info/debug>] ..."
  27. .br
  28. .RB "[" --ssl " " --nssdb " <string> " --client-cert-name " <string>]"
  29. .br
  30. .RB "[" --server-name " <string>]"
  31. .br
  32. .BR --server-addr " <addr>"
  33. .br
  34. .RB "[" --tapdev " <name>]"
  35. .br
  36. .RB "[" --scope " <scope_name>] ..."
  37. .br
  38. [
  39. .br
  40. .RS
  41. .BR --bind-addr " <addr>"
  42. .br
  43. .RB "(transport-mode=udp? " --num-ports " <num>)"
  44. .br
  45. .RB "[" --ext-addr " <addr / {server_reported}:port> <scope_name>] ..."
  46. .br
  47. .RE
  48. ]
  49. .br
  50. .BR --transport-mode " <udp/tcp>"
  51. .br
  52. (transport-mode=udp?
  53. .br
  54. .RS
  55. .BR --encryption-mode " <blowfish/aes/none>"
  56. .br
  57. .BR --hash-mode " <md5/sha1/none>"
  58. .br
  59. .RB "[" --otp " <blowfish/aes> <num> <num-warn>]"
  60. .br
  61. .RB "[" --fragmentation-latency " <milliseconds>]"
  62. .br
  63. .RE
  64. )
  65. .br
  66. (transport-mode=tcp?
  67. .br
  68. .RS
  69. .RB "(ssl? [" --peer-ssl "])"
  70. .br
  71. .RE
  72. )
  73. .br
  74. .RB "[" --send-buffer-size " <num-packets>]"
  75. .br
  76. .RB "[" --send-buffer-relay-size " <num-packets>]"
  77. .br
  78. .RE
  79. .SH INTRODUCTION
  80. .P
  81. This page documents the BadVPN client, a daemon for a node in a BadVPN VPN network.
  82. For a general description of BadVPN, see
  83. .BR badvpn (7).
  84. .SH DESCRIPTION
  85. .P
  86. The BadVPN client is a daemon that runs on a VPN node. It opens the TAP device, connects to
  87. the server, then keeps running while attempting to establish data connection to peers and
  88. tranferring data between the TAP device and the peers. Once it initializes, the program only
  89. terminates if it loses connection to the server, or if a signal is received.
  90. .SH OPTIONS
  91. .P
  92. The BadVPN client is configured entirely from command line.
  93. .TP
  94. .BR --help
  95. Print version and command line syntax and exit.
  96. .TP
  97. .BR --version
  98. Print version and exit.
  99. .TP
  100. .BR --logger " <stdout/syslog>"
  101. Select where to log messages. Default is stdout. Syslog is not available on Windows.
  102. .TP
  103. .BR --syslog-facility " <string>"
  104. When logging to syslog, set the logging facility. The facility name must be in lower case.
  105. .TP
  106. .BR --syslog-ident " <string>"
  107. When logging to syslog, set the ident.
  108. .TP
  109. .BR --loglevel " <0-5/none/error/warning/notice/info/debug>"
  110. Set the default logging level.
  111. .TP
  112. .BR --channel-loglevel " <channel-name> <0-5/none/error/warning/notice/info/debug>"
  113. Set the logging level for a specific logging channel.
  114. .TP
  115. .BR --ssl
  116. Use TLS. Requires --nssdb and --server-cert-name.
  117. .TP
  118. .BR --nssdb " <string>"
  119. When using TLS, the NSS database to use. Probably something like sql:/some/folder.
  120. .TP
  121. .BR --client-cert-name " <string>"
  122. When using TLS, the name of the certificate to use. The certificate must be readily accessible.
  123. .TP
  124. .BR --server-name " <string>"
  125. Set the name of the server used for validating the server's certificate. The server name defaults
  126. to the the name in the server address (or a numeric address).
  127. .TP
  128. .BR --server-addr " <addr>"
  129. Set the address for the server to listen on. See below for address format.
  130. .TP
  131. .BR --tapdev " <name>"
  132. Set the TAP device to use. See below on how to configure the device. A TAP device is a virtual card
  133. in the operating system, but rather than receiving from and sending frames to a piece of hardware,
  134. a program (this one) opens it to read from and write frames into. If the VPN network is set up correctly,
  135. the TAP devices on the VPN nodes will act as if they were all connected into a network switch.
  136. .TP
  137. .BR --scope " <scope_name>"
  138. Add an address scope allowed for connecting to peers. May be specified multiple times to add multiple
  139. scopes. The order of the scopes is irrelevant. Note that it must actually be possible to connect
  140. to addresses in the given scope; when another peer binds for us to connect to, we choose the first
  141. external address whose scope we recognize, and do not attempt further external addresses, even if
  142. establishing the connection fails.
  143. .TP
  144. .BR --bind-addr " <addr>"
  145. Add an address to allow binding on. See below for address format. When attempting to bind in order
  146. for some peer to connect to us, the addresses will be tried in the order they are specified. If UDP
  147. data transport is being used, a --num-ports option must follow to specify how many continuous ports
  148. to allow binding to. For the address to be useful, one or more --ext-addr options must follow.
  149. Note that when two peers need to establish a data connection, it is arbitrary which one will attempt
  150. to bind first.
  151. .TP
  152. .BR --num-ports " <num>"
  153. When using UDP transport, set the number of continuous ports for a previously specified bind address.
  154. Must follow a previous --bind-addr option.
  155. .TP
  156. .BR --ext-addr " <addr / {server_reported}:port> <scope_name>"
  157. Add an external address for a previously specified bind address. Must follow a previous --bind-addr
  158. option. May be specified multiple times to add multiple external addresses. See below for address
  159. format. Additionally, the IP address part can be {server_reported} to use the IPv4 address as the
  160. server sees us. The external addresses are tried by the connecting peer in the order they are specified.
  161. Note that the connecting peer only attempts to connect to the first address whose scope it recognizes
  162. and does not try other addresses. This means that all addresses must work for be able to communicate.
  163. .TP
  164. .BR --transport-mode " <udp/tcp>"
  165. Sets the transport protocol for data connections. UDP is recommended and works best for most networks.
  166. TCP can be used instead if the underlying network has high packet loss which your virtual network
  167. cannot tolerate. Must match on all peers.
  168. .TP
  169. .BR --encryption-mode " <blowfish/aes/none>"
  170. When using UDP transport, sets the encryption mode. None means no encryption, other options mean
  171. a specific cipher. Note that encryption is only useful if clients use TLS to connect to the server.
  172. The encryption mode must match on all peers.
  173. .TP
  174. .BR --hash-mode " <md5/sha1/none>"
  175. When using UDP transport, sets the hashing mode. None means no hashes, other options mean a specific
  176. type of hash. Note that hashing is only useful if encryption is used as well. The hash mode must
  177. match on all peers.
  178. .TP
  179. .BR --otp " <blowfish/aes> <num> <num-warn>"
  180. When using UDP transport, enables one-time passwords. The first argument specifies a block cipher
  181. used to generate passwords from a seed. The second argument specifies how many passwords are
  182. generated from a single seed. The third argument specifies after how many passwords used up for
  183. sending packets an attempt is made to negotiate a new seed with the other peer. num must be >0,
  184. and num-warn must be >0 and <=num. The difference (num - num-warn) should be large enough to allow
  185. a new seed to be negotiated before the sender runs out of passwords. Negotiating a seed involves
  186. the sending peer sending it to the receiving peer via the server and the receiving peer confirming
  187. it via the server. Note that one-time passwords are only useful if clients use TLS to connect to the
  188. server. The OTP option must match on all peers, except for num-warn.
  189. .TP
  190. .BR --fragmentation-latency " <milliseconds>"
  191. When using UDP transport, sets the maximum latency to sacrifice in order to pack frames into data
  192. packets more efficiently. If it is >=0, a timer of that many milliseconds is used to wait for further
  193. frames to put into an incomplete packet since the first chunk of the packet was written. If it is
  194. <0, packets are sent out immediately. Defaults to 0, which is the recommended setting.
  195. .TP
  196. .BR --peer-ssl
  197. When using TCP transport, enables TLS for data connections. Requires using TLS for server connection.
  198. For this to work, the peers must trust each others' cerificates, and the cerificates must grant the
  199. TLS server usage context. This option must match on all peers.
  200. .TP
  201. .BR --send-buffer-size " <num-packets>"
  202. Sets the minimum size of the peers' send buffers for sending frames originating from this system, in
  203. number of packets.
  204. .TP
  205. .BR --send-buffer-relay-size " <num-packets>"
  206. Sets the minimum size of the peers' send buffers for relaying frames from other peers, in number of
  207. packets.
  208. .SH "EXIT CODE"
  209. .P
  210. If initialization fails, exits with code 1. Otherwise runs until termination is requested or server connection
  211. is broken and exits with code 1.
  212. .SH "ADDRESS FORMAT"
  213. .P
  214. Addresses have the form ipaddr:port, where ipaddr is either an IPv4 address (name or numeric), or an
  215. IPv6 address enclosed in brackets [] (name or numeric again).
  216. .SH "TAP DEVICE CONFIGURATION"
  217. .P
  218. To use this program, you first have to configure a TAP network device that will act as an endpoint for
  219. the virtual network. The configuration depends on your operating system.
  220. .P
  221. Note that the client program does not configure the TAP device in any way; it only reads and writes
  222. frames from/to it. You are responsible for configuring it (e.g. putting it up and setting its IP address).
  223. .P
  224. .B Linux
  225. .P
  226. You need to enable the kernel configuration option CONFIG_TUN. If you enabled it as a module, you may
  227. have to load it (`modprobe tun`) before you can create the device.
  228. .P
  229. Then you should create a persistent TAP device for the VPN client program to open. This can be done with
  230. either the
  231. .B tunctl
  232. or the
  233. .B openvpn
  234. program. The device will be associated with a user account that will have permission to use it, which should
  235. be the same user as the client program will run as (not root!). To create the device with tunctl, use `tunctl -u <user> -t tapN`,
  236. and to create it with openvpn, use `openvpn --mktun --user <user> --dev tapN`, where N is a number that identifies the
  237. TAP device.
  238. .P
  239. Once the TAP device is created, pass `--tapdev tapN` to the client program to make it use this device. Note that the
  240. device will not be preserved across a shutdown of the system; consult your OS documentaton if you want to automate
  241. the creation or configuration of the device.
  242. .P
  243. .B Windows
  244. .P
  245. Windows does not come with a TAP driver. The client program uses the TAP-Win32 driver, which is part of OpenVPN.
  246. You need to install the OpenVPN open source (!) version, and in the installer enable at least the
  247. `TAP Virtual Ethernet Adapter` and `Add Shortcuts to Start Menu` options.
  248. You can get the installer at
  249. .br
  250. <http://openvpn.net/index.php/open-source/downloads.html>.
  251. .P
  252. The OpenVPN installer automatically creates one TAP device on your system when it's run for the first time.
  253. To create another device, use `Programs -> OpenVPN -> Utilities -> Add a new TAP virtual ethernet adapter`.
  254. You may have to install OpenVPN once again to make this shortcut appear.
  255. .P
  256. Once you have a TAP device, you can configure it like a physical network card. You can recognize TAP devices
  257. by their `Device Name` field.
  258. .P
  259. To use the device, pass `--tapdev "<driver_name>:<interface_name>"` to the client program, where <driver_name> is the name of
  260. the TAP driver (tap0901 for OpenVPN 2.1 and 2.2) (case sensitive), and <interface_name> is the (human) name of the TAP
  261. network interface (e.g. `Local Area Connection 2`).
  262. .SH "EXAMPLES"
  263. .P
  264. For examples of using BadVPN, see
  265. .BR badvpn (7).
  266. .SH "SEE ALSO"
  267. .BR badvpn-server (8),
  268. .BR badvpn (7)
  269. .SH COPYRIGHT
  270. Copyright (C) 2010 Ambroz Bizjak. BadVPN is free software; you can redistribute it and/or
  271. modify it under the terms of the GNU General Public License version 2 as published by the
  272. Free Software Foundation.
  273. .SH AUTHORS
  274. Ambroz Bizjak <ambrop7@gmail.com>