badvpn-client.8 12 KB

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