Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.84 KB | None | 0 0
  1. cat server.conf
  2. #################################################
  3. # Sample OpenVPN 2.0 config file for #
  4. # multi-client server. #
  5. # #
  6. # This file is for the server side #
  7. # of a many-clients <-> one-server #
  8. # OpenVPN configuration. #
  9. # #
  10. # OpenVPN also supports #
  11. # single-machine <-> single-machine #
  12. # configurations (See the Examples page #
  13. # on the web site for more info). #
  14. # #
  15. # This config should work on Windows #
  16. # or Linux/BSD systems. Remember on #
  17. # Windows to quote pathnames and use #
  18. # double backslashes, e.g.: #
  19. # "C:\\Program Files\\OpenVPN\\config\\foo.key" #
  20. # #
  21. # Comments are preceded with '#' or ';' #
  22. #################################################
  23.  
  24. # Which local IP address should OpenVPN
  25. # listen on? (optional)
  26. ;local a.b.c.d
  27.  
  28. # Which TCP/UDP port should OpenVPN listen on?
  29. # If you want to run multiple OpenVPN instances
  30. # on the same machine, use a different port
  31. # number for each one. You will need to
  32. # open up this port on your firewall.
  33. port 1194
  34.  
  35. # TCP or UDP server?
  36. ;proto tcp
  37. proto udp
  38.  
  39. # "dev tun" will create a routed IP tunnel,
  40. # "dev tap" will create an ethernet tunnel.
  41. # Use "dev tap0" if you are ethernet bridging
  42. # and have precreated a tap0 virtual interface
  43. # and bridged it with your ethernet interface.
  44. # If you want to control access policies
  45. # over the VPN, you must create firewall
  46. # rules for the the TUN/TAP interface.
  47. # On non-Windows systems, you can give
  48. # an explicit unit number, such as tun0.
  49. # On Windows, use "dev-node" for this.
  50. # On most systems, the VPN will not function
  51. # unless you partially or fully disable
  52. # the firewall for the TUN/TAP interface.
  53. ;dev tap
  54. dev tun
  55.  
  56. # Windows needs the TAP-Win32 adapter name
  57. # from the Network Connections panel if you
  58. # have more than one. On XP SP2 or higher,
  59. # you may need to selectively disable the
  60. # Windows firewall for the TAP adapter.
  61. # Non-Windows systems usually don't need this.
  62. ;dev-node MyTap
  63.  
  64. # SSL/TLS root certificate (ca), certificate
  65. # (cert), and private key (key). Each client
  66. # and the server must have their own cert and
  67. # key file. The server and all clients will
  68. # use the same ca file.
  69. #
  70. # See the "easy-rsa" directory for a series
  71. # of scripts for generating RSA certificates
  72. # and private keys. Remember to use
  73. # a unique Common Name for the server
  74. # and each of the client certificates.
  75. #
  76. # Any X509 key management system can be used.
  77. # OpenVPN can also use a PKCS #12 formatted key file
  78. # (see "pkcs12" directive in man page).
  79. ca ca.crt
  80. cert server.crt
  81. key server.key # This file should be kept secret
  82.  
  83. # Diffie hellman parameters.
  84. # Generate your own with:
  85. # openssl dhparam -out dh2048.pem 2048
  86. dh dh2048.pem
  87.  
  88. # Network topology
  89. # Should be subnet (addressing via IP)
  90. # unless Windows clients v2.0.9 and lower have to
  91. # be supported (then net30, i.e. a /30 per client)
  92. # Defaults to net30 (not recommended)
  93. ;topology subnet
  94.  
  95. # Configure server mode and supply a VPN subnet
  96. # for OpenVPN to draw client addresses from.
  97. # The server will take 10.8.0.1 for itself,
  98. # the rest will be made available to clients.
  99. # Each client will be able to reach the server
  100. # on 10.8.0.1. Comment this line out if you are
  101. # ethernet bridging. See the man page for more info.
  102. server 10.8.0.0 255.255.255.0
  103.  
  104. # Maintain a record of client <-> virtual IP address
  105. # associations in this file. If OpenVPN goes down or
  106. # is restarted, reconnecting clients can be assigned
  107. # the same virtual IP address from the pool that was
  108. # previously assigned.
  109. ifconfig-pool-persist ipp.txt
  110.  
  111. # Configure server mode for ethernet bridging.
  112. # You must first use your OS's bridging capability
  113. # to bridge the TAP interface with the ethernet
  114. # NIC interface. Then you must manually set the
  115. # IP/netmask on the bridge interface, here we
  116. # assume 10.8.0.4/255.255.255.0. Finally we
  117. # must set aside an IP range in this subnet
  118. # (start=10.8.0.50 end=10.8.0.100) to allocate
  119. # to connecting clients. Leave this line commented
  120. # out unless you are ethernet bridging.
  121. ;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
  122.  
  123. # Configure server mode for ethernet bridging
  124. # using a DHCP-proxy, where clients talk
  125. # to the OpenVPN server-side DHCP server
  126. # to receive their IP address allocation
  127. # and DNS server addresses. You must first use
  128. # your OS's bridging capability to bridge the TAP
  129. # interface with the ethernet NIC interface.
  130. # Note: this mode only works on clients (such as
  131. # Windows), where the client-side TAP adapter is
  132. # bound to a DHCP client.
  133. ;server-bridge
  134.  
  135. # Push routes to the client to allow it
  136. # to reach other private subnets behind
  137. # the server. Remember that these
  138. # private subnets will also need
  139. # to know to route the OpenVPN client
  140. # address pool (10.8.0.0/255.255.255.0)
  141. # back to the OpenVPN server.
  142. ;push "route 192.168.10.0 255.255.255.0"
  143. ;push "route 192.168.20.0 255.255.255.0"
  144.  
  145. # To assign specific IP addresses to specific
  146. # clients or if a connecting client has a private
  147. # subnet behind it that should also have VPN access,
  148. # use the subdirectory "ccd" for client-specific
  149. # configuration files (see man page for more info).
  150.  
  151. # EXAMPLE: Suppose the client
  152. # having the certificate common name "Thelonious"
  153. # also has a small subnet behind his connecting
  154. # machine, such as 192.168.40.128/255.255.255.248.
  155. # First, uncomment out these lines:
  156. ;client-config-dir ccd
  157. ;route 192.168.40.128 255.255.255.248
  158. # Then create a file ccd/Thelonious with this line:
  159. # iroute 192.168.40.128 255.255.255.248
  160. # This will allow Thelonious' private subnet to
  161. # access the VPN. This example will only work
  162. # if you are routing, not bridging, i.e. you are
  163. # using "dev tun" and "server" directives.
  164.  
  165. # EXAMPLE: Suppose you want to give
  166. # Thelonious a fixed VPN IP address of 10.9.0.1.
  167. # First uncomment out these lines:
  168. ;client-config-dir ccd
  169. ;route 10.9.0.0 255.255.255.252
  170. # Then add this line to ccd/Thelonious:
  171. # ifconfig-push 10.9.0.1 10.9.0.2
  172.  
  173. # Suppose that you want to enable different
  174. # firewall access policies for different groups
  175. # of clients. There are two methods:
  176. # (1) Run multiple OpenVPN daemons, one for each
  177. # group, and firewall the TUN/TAP interface
  178. # for each group/daemon appropriately.
  179. # (2) (Advanced) Create a script to dynamically
  180. # modify the firewall in response to access
  181. # from different clients. See man
  182. # page for more info on learn-address script.
  183. ;learn-address ./script
  184.  
  185. # If enabled, this directive will configure
  186. # all clients to redirect their default
  187. # network gateway through the VPN, causing
  188. # all IP traffic such as web browsing and
  189. # and DNS lookups to go through the VPN
  190. # (The OpenVPN server machine may need to NAT
  191. # or bridge the TUN/TAP interface to the internet
  192. # in order for this to work properly).
  193. push "redirect-gateway def1 bypass-dhcp"
  194.  
  195. # Certain Windows-specific network settings
  196. # can be pushed to clients, such as DNS
  197. # or WINS server addresses. CAVEAT:
  198. # http://openvpn.net/faq.html#dhcpcaveats
  199. # The addresses below refer to the public
  200. # DNS servers provided by opendns.com.
  201. push "dhcp-option DNS 8.8.8.8"
  202. push "dhcp-option DNS 8.8.4.4"
  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. # Note that 2.4 client/server will automatically
  251. # negotiate AES-256-GCM in TLS mode.
  252. # See also the ncp-cipher option in the manpage
  253. cipher AES-256-CBC
  254.  
  255. # Enable compression on the VPN link and push the
  256. # option to the client (2.4+ only, for earlier
  257. # versions see below)
  258. ;compress lz4-v2
  259. ;push "compress lz4-v2"
  260.  
  261. # For compression compatible with older clients use comp-lzo
  262. # If you enable it here, you must also
  263. # enable it in the client config file.
  264. ;comp-lzo
  265.  
  266. # The maximum number of concurrently connected
  267. # clients we want to allow.
  268. ;max-clients 100
  269.  
  270. # It's a good idea to reduce the OpenVPN
  271. # daemon's privileges after initialization.
  272. #
  273. # You can uncomment this out on
  274. # non-Windows systems.
  275. user nobody
  276. group nobody
  277.  
  278. # The persist options will try to avoid
  279. # accessing certain resources on restart
  280. # that may no longer be accessible because
  281. # of the privilege downgrade.
  282. persist-key
  283. persist-tun
  284.  
  285. # Output a short status file showing
  286. # current connections, truncated
  287. # and rewritten every minute.
  288. status openvpn-status.log
  289.  
  290. # By default, log messages will go to the syslog (or
  291. # on Windows, if running as a service, they will go to
  292. # the "\Program Files\OpenVPN\log" directory).
  293. # Use log or log-append to override this default.
  294. # "log" will truncate the log file on OpenVPN startup,
  295. # while "log-append" will append to it. Use one
  296. # or the other (but not both).
  297. ;log openvpn.log
  298. ;log-append openvpn.log
  299.  
  300. # Set the appropriate level of log
  301. # file verbosity.
  302. #
  303. # 0 is silent, except for fatal errors
  304. # 4 is reasonable for general usage
  305. # 5 and 6 can help to debug connection problems
  306. # 9 is extremely verbose
  307. verb 3
  308.  
  309. # Silence repeating messages. At most 20
  310. # sequential messages of the same message
  311. # category will be output to the log.
  312. ;mute 20
  313.  
  314. # Notify the client that when the server restarts so it
  315. # can automatically reconnect.
  316. explicit-exit-notify 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement