Guest User

OVPN config

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