Advertisement
Guest User

UDP - Server

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