NoPaste

Re: Einstellungen Openvpn

von KBDCALLS
SNIPPET_DESC:
https://debianforum.de/forum/posting.php?mode=edit&f=30&p=1148962
SNIPPET_CREATION_TIME:
16.11.2020 12:48:24
SNIPPET_PRUNE_TIME:
Unendlich

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

Quellcode

Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen. PASTEBIN_DOWNLOAD_SNIPPET_EXPLAIN