home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 April / CHIP_CD_2005-04.iso / bonus / srew / files / openvpn-2.0_rc16-install.exe / sample-config / server.ovpn < prev   
Encoding:
Text File  |  2005-02-20  |  9.9 KB  |  290 lines

  1. #################################################
  2. # Sample OpenVPN 2.0 config file for            #
  3. # multi-client server.                          #
  4. #                                               #
  5. # This file is for the server side              #
  6. # of a many-clients <-> one-server              #
  7. # OpenVPN configuration.                        #
  8. #                                               #
  9. # OpenVPN also supports                         #
  10. # single-machine <-> single-machine             #
  11. # configurations (See the Examples page         #
  12. # on the web site for more info).               #
  13. #                                               #
  14. # This config should work on Windows            #
  15. # or Linux/BSD systems.  Remember on            #
  16. # Windows to quote pathnames and use            #
  17. # double backslashes, e.g.:                     #
  18. # "C:\\Program Files\\OpenVPN\\config\\foo.key" #
  19. #                                               #
  20. # Comments are preceded with '#' or ';'         #
  21. #################################################
  22.  
  23. # Which local IP address should OpenVPN
  24. # listen on? (optional)
  25. ;local a.b.c.d
  26.  
  27. # Which TCP/UDP port should OpenVPN listen on?
  28. # If you want to run multiple OpenVPN instances
  29. # on the same machine, use a different port
  30. # number for each one.  You will need to
  31. # open up this port on your firewall.
  32. port 1194
  33.  
  34. # TCP or UDP server?
  35. ;proto tcp
  36. proto udp
  37.  
  38. # "dev tun" will create a routed IP tunnel,
  39. # "dev tap" will create an ethernet tunnel.
  40. # Use "dev tap" if you are ethernet bridging.
  41. # If you want to control access policies
  42. # over the VPN, you must create firewall
  43. # rules for the the TUN/TAP interface.
  44. # On non-Windows systems, you can give
  45. # an explicit unit number, such as tun0.
  46. # On Windows, use "dev-node" for this.
  47. # On most systems, the VPN will not function
  48. # unless you partially or fully disable
  49. # the firewall for the TUN/TAP interface.
  50. ;dev tap
  51. dev tun
  52.  
  53. # Windows needs the TAP-Win32 adapter name
  54. # from the Network Connections panel if you
  55. # have more than one.  On XP SP2 or higher,
  56. # you may need to selectively disable the
  57. # Windows firewall for the TAP adapter.
  58. # Non-Windows systems usually don't need this.
  59. ;dev-node MyTap
  60.  
  61. # SSL/TLS root certificate (ca), certificate
  62. # (cert), and private key (key).  Each client
  63. # and the server must have their own cert and
  64. # key file.  The server and all clients will
  65. # use the same ca file.
  66. #
  67. # See the "easy-rsa" directory for a series
  68. # of scripts for generating RSA certificates
  69. # and private keys.  Remember to use
  70. # a unique Common Name for the server
  71. # and each of the client certificates.
  72. #
  73. # Any X509 key management system can be used.
  74. # OpenVPN can also use a PKCS #12 formatted key file
  75. # (see "pkcs12" directive in man page).
  76. ca ca.crt
  77. cert server.crt
  78. key server.key  # This file should be kept secret
  79.  
  80. # Diffie hellman parameters.
  81. # Generate your own with:
  82. #   openssl dhparam -out dh1024.pem 1024
  83. # Substitute 2048 for 1024 if you are using
  84. # 2048 bit keys. 
  85. dh dh1024.pem
  86.  
  87. # Configure server mode and supply a VPN subnet
  88. # for OpenVPN to draw client addresses from.
  89. # The server will take 10.8.0.1 for itself,
  90. # the rest will be made available to clients.
  91. # Each client will be able to reach the server
  92. # on 10.8.0.1. Comment this line out if you are
  93. # ethernet bridging. See the man page for more info.
  94. server 10.8.0.0 255.255.255.0
  95.  
  96. # Maintain a record of client <-> virtual IP address
  97. # associations in this file.  If OpenVPN goes down or
  98. # is restarted, reconnecting clients can be assigned
  99. # the same virtual IP address from the pool that was
  100. # previously assigned.
  101. ifconfig-pool-persist ipp.txt
  102.  
  103. # Configure server mode for ethernet bridging.
  104. # You must first use your OS's bridging capability
  105. # to bridge the TAP interface with the ethernet
  106. # NIC interface.  Then you must manually set the
  107. # IP/netmask on the bridge interface, here we
  108. # assume 10.8.0.4/255.255.255.0.  Finally we
  109. # must set aside an IP range in this subnet
  110. # (start=10.8.0.50 end=10.8.0.100) to allocate
  111. # to connecting clients.  Leave this line commented
  112. # out unless you are ethernet bridging.
  113. ;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
  114.  
  115. # Push routes to the client to allow it
  116. # to reach other private subnets behind
  117. # the server.  Remember that these
  118. # private subnets will also need
  119. # to know to route the OpenVPN client
  120. # address pool (10.8.0.0/255.255.255.0)
  121. # back to the OpenVPN server.
  122. ;push "route 192.168.10.0 255.255.255.0"
  123. ;push "route 192.168.20.0 255.255.255.0"
  124.  
  125. # To assign specific IP addresses to specific
  126. # clients or if a connecting client has a private
  127. # subnet behind it that should also have VPN access,
  128. # use the subdirectory "ccd" for client-specific
  129. # configuration files (see man page for more info).
  130.  
  131. # EXAMPLE: Suppose the client
  132. # having the certificate common name "Thelonious"
  133. # also has a small subnet behind his connecting
  134. # machine, such as 192.168.40.128/255.255.255.248.
  135. # First, uncomment out these lines:
  136. ;client-config-dir ccd
  137. ;route 192.168.40.128 255.255.255.248
  138. # Then create a file ccd/Thelonious with this line:
  139. #   iroute 192.168.40.128 255.255.255.248
  140. # This will allow Thelonious' private subnet to
  141. # access the VPN.  This example will only work
  142. # if you are routing, not bridging, i.e. you are
  143. # using "dev tun" and "server" directives.
  144.  
  145. # EXAMPLE: Suppose you want to give
  146. # Thelonious a fixed VPN IP address of 10.9.0.1.
  147. # First uncomment out these lines:
  148. ;client-config-dir ccd
  149. ;route 10.9.0.0 255.255.255.252
  150. # Then add this line to ccd/Thelonious:
  151. #   ifconfig-push 10.9.0.1 10.9.0.2
  152.  
  153. # Suppose that you want to enable different
  154. # firewall access policies for different groups
  155. # of clients.  There are two methods:
  156. # (1) Run multiple OpenVPN daemons, one for each
  157. #     group, and firewall the TUN/TAP interface
  158. #     for each group/daemon appropriately.
  159. # (2) (Advanced) Create a script to dynamically
  160. #     modify the firewall in response to access
  161. #     from different clients.  See man
  162. #     page for more info on learn-address script.
  163. ;learn-address ./script
  164.  
  165. # If enabled, this directive will configure
  166. # all clients to redirect their default
  167. # network gateway through the VPN, causing
  168. # all IP traffic such as web browsing and
  169. # and DNS lookups to go through the VPN
  170. # (The OpenVPN server machine may need to NAT
  171. # the TUN/TAP interface to the internet in
  172. # order for this to work properly).
  173. # CAVEAT: May break client's network config if
  174. # client's local DHCP server packets get routed
  175. # through the tunnel.  Solution: make sure
  176. # client's local DHCP server is reachable via
  177. # a more specific route than the default route
  178. # of 0.0.0.0/0.0.0.0.
  179. ;push "redirect-gateway"
  180.  
  181. # Certain Windows-specific network settings
  182. # can be pushed to clients, such as DNS
  183. # or WINS server addresses.  CAVEAT:
  184. # http://openvpn.net/faq.html#dhcpcaveats
  185. ;push "dhcp-option DNS 10.8.0.1"
  186. ;push "dhcp-option WINS 10.8.0.1"
  187.  
  188. # Uncomment this directive to allow different
  189. # clients to be able to "see" each other.
  190. # By default, clients will only see the server.
  191. # To force clients to only see the server, you
  192. # will also need to appropriately firewall the
  193. # server's TUN/TAP interface.
  194. ;client-to-client
  195.  
  196. # Uncomment this directive if multiple clients
  197. # might connect with the same certificate/key
  198. # files or common names.  This is recommended
  199. # only for testing purposes.  For production use,
  200. # each client should have its own certificate/key
  201. # pair.
  202. #
  203. # IF YOU HAVE NOT GENERATED INDIVIDUAL
  204. # CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
  205. # EACH HAVING ITS OWN UNIQUE "COMMON NAME",
  206. # UNCOMMENT THIS LINE OUT.
  207. ;duplicate-cn
  208.  
  209. # The keepalive directive causes ping-like
  210. # messages to be sent back and forth over
  211. # the link so that each side knows when
  212. # the other side has gone down.
  213. # Ping every 10 seconds, assume that remote
  214. # peer is down if no ping received during
  215. # a 120 second time period.
  216. keepalive 10 120
  217.  
  218. # For extra security beyond that provided
  219. # by SSL/TLS, create an "HMAC firewall"
  220. # to help block DoS attacks and UDP port flooding.
  221. #
  222. # Generate with:
  223. #   openvpn --genkey --secret ta.key
  224. #
  225. # The server and each client must have
  226. # a copy of this key.
  227. # The second parameter should be '0'
  228. # on the server and '1' on the clients.
  229. ;tls-auth ta.key 0 # This file is secret
  230.  
  231. # Select a cryptographic cipher.
  232. # This config item must be copied to
  233. # the client config file as well.
  234. ;cipher BF-CBC        # Blowfish (default)
  235. ;cipher AES-128-CBC   # AES
  236. ;cipher DES-EDE3-CBC  # Triple-DES
  237.  
  238. # Enable compression on the VPN link.
  239. # If you enable it here, you must also
  240. # enable it in the client config file.
  241. comp-lzo
  242.  
  243. # The maximum number of concurrently connected
  244. # clients we want to allow.
  245. ;max-clients 100
  246.  
  247. # It's a good idea to reduce the OpenVPN
  248. # daemon's privileges after initialization.
  249. #
  250. # You can uncomment this out on
  251. # non-Windows systems.
  252. user nobody
  253. group nobody
  254.  
  255. # The persist options will try to avoid
  256. # accessing certain resources on restart
  257. # that may no longer be accessible because
  258. # of the privilege downgrade.
  259. persist-key
  260. persist-tun
  261.  
  262. # Output a short status file showing
  263. # current connections, truncated
  264. # and rewritten every minute.
  265. status openvpn-status.log
  266.  
  267. # By default, log messages will go to the syslog (or
  268. # on Windows, if running as a service, they will go to
  269. # the "\Program Files\OpenVPN\log" directory).
  270. # Use log or log-append to override this default.
  271. # "log" will truncate the log file on OpenVPN startup,
  272. # while "log-append" will append to it.  Use one
  273. # or the other (but not both).
  274. ;log         openvpn.log
  275. ;log-append  openvpn.log
  276.  
  277. # Set the appropriate level of log
  278. # file verbosity.
  279. #
  280. # 0 is silent, except for fatal errors
  281. # 4 is reasonable for general usage
  282. # 5 and 6 can help to debug connection problems
  283. # 9 is extremely verbose
  284. verb 3
  285.  
  286. # Silence repeating messages.  At most 20
  287. # sequential messages of the same message
  288. # category will be output to the log.
  289. ;mute 20
  290.