Advertisement
Guest User

Untitled

a guest
Mar 4th, 2020
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.11 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 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 65532
  33.  
  34. # TCP or UDP server?
  35. proto tcp4-server
  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 tap
  53. ;dev tun
  54. ;up "/etc/openvpn/up.sh br0 eth1"
  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 TrainzCityVPN
  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 TrainzCityVPN.crt
  81. key TrainzCityVPN.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 dh4096.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 "C:\\Program Files\\OpenVPN\\log\\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 192.168.2.1 255.255.255.0 192.168.2.100 192.168.2.150
  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.1.0 255.255.255.0"
  143. push "route 192.168.0.0 255.255.255.0"
  144. route-delay 5
  145. route-method exe
  146.  
  147. # To assign specific IP addresses to specific
  148. # clients or if a connecting client has a private
  149. # subnet behind it that should also have VPN access,
  150. # use the subdirectory "ccd" for client-specific
  151. # configuration files (see man page for more info).
  152.  
  153. # EXAMPLE: Suppose the client
  154. # having the certificate common name "Thelonious"
  155. # also has a small subnet behind his connecting
  156. # machine, such as 192.168.40.128/255.255.255.248.
  157. # First, uncomment out these lines:
  158. client-config-dir "C:\\Program Files\\OpenVPN\\config\\ccd"
  159. route 192.168.43.0 255.255.255.0 10.8.0.5
  160. # Then create a file ccd/Thelonious with this line:
  161. # iroute 192.168.40.128 255.255.255.248
  162. # This will allow Thelonious' private subnet to
  163. # access the VPN. This example will only work
  164. # if you are routing, not bridging, i.e. you are
  165. # using "dev tun" and "server" directives.
  166.  
  167. # EXAMPLE: Suppose you want to give
  168. # Thelonious a fixed VPN IP address of 10.9.0.1.
  169. # First uncomment out these lines:
  170. ;client-config-dir ccd
  171. ;route 10.9.0.0 255.255.255.252
  172. # Then add this line to ccd/Thelonious:
  173. # ifconfig-push 10.9.0.1 10.9.0.2
  174.  
  175. # Suppose that you want to enable different
  176. # firewall access policies for different groups
  177. # of clients. There are two methods:
  178. # (1) Run multiple OpenVPN daemons, one for each
  179. # group, and firewall the TUN/TAP interface
  180. # for each group/daemon appropriately.
  181. # (2) (Advanced) Create a script to dynamically
  182. # modify the firewall in response to access
  183. # from different clients. See man
  184. # page for more info on learn-address script.
  185. ;learn-address ./script
  186.  
  187. # If enabled, this directive will configure
  188. # all clients to redirect their default
  189. # network gateway through the VPN, causing
  190. # all IP traffic such as web browsing and
  191. # and DNS lookups to go through the VPN
  192. # (The OpenVPN server machine may need to NAT
  193. # or bridge the TUN/TAP interface to the internet
  194. # in order for this to work properly).
  195. ;push "redirect-gateway def1 bypass-dhcp"
  196.  
  197. # Certain Windows-specific network settings
  198. # can be pushed to clients, such as DNS
  199. # or WINS server addresses. CAVEAT:
  200. # http://openvpn.net/faq.html#dhcpcaveats
  201. # The addresses below refer to the public
  202. # DNS servers provided by opendns.com.
  203. push "dhcp-option DNS 8.8.8.8"
  204. push "dhcp-option DNS 8.8.4.4"
  205.  
  206. # Uncomment this directive to allow different
  207. # clients to be able to "see" each other.
  208. # By default, clients will only see the server.
  209. # To force clients to only see the server, you
  210. # will also need to appropriately firewall the
  211. # server's TUN/TAP interface.
  212. client-to-client
  213.  
  214. # Uncomment this directive if multiple clients
  215. # might connect with the same certificate/key
  216. # files or common names. This is recommended
  217. # only for testing purposes. For production use,
  218. # each client should have its own certificate/key
  219. # pair.
  220. #
  221. # IF YOU HAVE NOT GENERATED INDIVIDUAL
  222. # CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
  223. # EACH HAVING ITS OWN UNIQUE "COMMON NAME",
  224. # UNCOMMENT THIS LINE OUT.
  225. ;duplicate-cn
  226.  
  227. # The keepalive directive causes ping-like
  228. # messages to be sent back and forth over
  229. # the link so that each side knows when
  230. # the other side has gone down.
  231. # Ping every 10 seconds, assume that remote
  232. # peer is down if no ping received during
  233. # a 120 second time period.
  234. keepalive 10 120
  235.  
  236. # For extra security beyond that provided
  237. # by SSL/TLS, create an "HMAC firewall"
  238. # to help block DoS attacks and UDP port flooding.
  239. #
  240. # Generate with:
  241. # openvpn --genkey --secret ta.key
  242. #
  243. # The server and each client must have
  244. # a copy of this key.
  245. # The second parameter should be '0'
  246. # on the server and '1' on the clients.
  247. tls-auth ta.key 0 # This file is secret
  248. key-direction 0
  249.  
  250. # Select a cryptographic cipher.
  251. # This config item must be copied to
  252. # the client config file as well.
  253. # Note that v2.4 client/server will automatically
  254. # negotiate AES-256-GCM in TLS mode.
  255. # See also the ncp-cipher option in the manpage
  256. cipher AES-256-CBC
  257.  
  258. # Enable compression on the VPN link and push the
  259. # option to the client (v2.4+ only, for earlier
  260. # versions see below)
  261. ;compress lz4-v2
  262. ;push "compress lz4-v2"
  263.  
  264. # For compression compatible with older clients use comp-lzo
  265. # If you enable it here, you must also
  266. # enable it in the client config file.
  267. comp-lzo
  268.  
  269. # The maximum number of concurrently connected
  270. # clients we want to allow.
  271. ;max-clients 100
  272.  
  273. # It's a good idea to reduce the OpenVPN
  274. # daemon's privileges after initialization.
  275. #
  276. # You can uncomment this out on
  277. # non-Windows systems.
  278. ;user nobody
  279. ;group nogroup
  280.  
  281. # The persist options will try to avoid
  282. # accessing certain resources on restart
  283. # that may no longer be accessible because
  284. # of the privilege downgrade.
  285. persist-key
  286. persist-tun
  287.  
  288. # Output a short status file showing
  289. # current connections, truncated
  290. # and rewritten every minute.
  291. status "C:\\Program Files\\OpenVPN\\log\\openvpn-status.log"
  292.  
  293. # By default, log messages will go to the syslog (or
  294. # on Windows, if running as a service, they will go to
  295. # the "\Program Files\OpenVPN\log" directory).
  296. # Use log or log-append to override this default.
  297. # "log" will truncate the log file on OpenVPN startup,
  298. # while "log-append" will append to it. Use one
  299. # or the other (but not both).
  300. log "C:\\Program Files\\OpenVPN\\log\\openvpn.log"
  301. log-append "C:\\Program Files\\OpenVPN\\log\\openvpn.log"
  302.  
  303. # Set the appropriate level of log
  304. # file verbosity.
  305. #
  306. # 0 is silent, except for fatal errors
  307. # 4 is reasonable for general usage
  308. # 5 and 6 can help to debug connection problems
  309. # 9 is extremely verbose
  310. verb 3
  311.  
  312. # Silence repeating messages. At most 20
  313. # sequential messages of the same message
  314. # category will be output to the log.
  315. mute 20
  316.  
  317. # Notify the client that when the server restarts so it
  318. # can automatically reconnect.
  319. #explicit-exit-notify 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement