Advertisement
grantjohnston

server.conf

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