Advertisement
Guest User

Untitled

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