SHARE
TWEET

Untitled

a guest Sep 3rd, 2018 199 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ##############################################
  2. # Sample client-side OpenVPN 2.0 config file #
  3. # for connecting to multi-client server.     #
  4. #                                            #
  5. # This configuration can be used by multiple #
  6. # clients, however each client should have   #
  7. # its own cert and key files.                #
  8. #                                            #
  9. # On Windows, you might want to rename this  #
  10. # file so it has a .ovpn extension           #
  11. ##############################################
  12.  
  13.  
  14.  
  15.  
  16. # Specify that we are a client and that we
  17. # will be pulling certain config file directives
  18. # from the server.
  19. client
  20. auth-user-pass
  21.  
  22. # Use the same setting as you are using on
  23. # the server.
  24. # On most systems, the VPN will not function
  25. # unless you partially or fully disable
  26. # the firewall for the TUN/TAP interface.
  27. ;dev tap
  28. dev tun
  29.  
  30. # Windows needs the TAP-Win32 adapter name
  31. # from the Network Connections panel
  32. # if you have more than one.  On XP SP2,
  33. # you may need to disable the firewall
  34. # for the TAP adapter.
  35. ;dev-node MyTap
  36.  
  37. # Are we connecting to a TCP or
  38. # UDP server?  Use the same setting as
  39. # on the server.
  40. ;proto tcp
  41. proto udp
  42.  
  43. # The hostname/IP and port of the server.
  44. # You can have multiple remote entries
  45. # to load balance between the servers.
  46. remote IPREMOVED 1194
  47.  
  48. # Choose a random host from the remote
  49. # list for load-balancing.  Otherwise
  50. # try hosts in the order specified.
  51. ;remote-random
  52.  
  53. # Keep trying indefinitely to resolve the
  54. # host name of the OpenVPN server.  Very useful
  55. # on machines which are not permanently connected
  56. # to the internet such as laptops.
  57. resolv-retry infinite
  58.  
  59. # Most clients don't need to bind to
  60. # a specific local port number.
  61. nobind
  62.  
  63. # Downgrade privileges after initialization (non-Windows only)
  64. #user nobody
  65. #group nogroup
  66.  
  67. # Try to preserve some state across restarts.
  68. persist-key
  69. persist-tun
  70.  
  71. # If you are connecting through an
  72. # HTTP proxy to reach the actual OpenVPN
  73. # server, put the proxy server/IP and
  74. # port number here.  See the man page
  75. # if your proxy server requires
  76. # authentication.
  77. ;http-proxy-retry # retry on connection failures
  78. ;http-proxy [proxy server] [proxy port #]
  79.  
  80.  
  81. # Wireless networks often produce a lot
  82. # of duplicate packets.  Set this flag
  83. # to silence duplicate packet warnings.
  84. ;mute-replay-warnings
  85.  
  86. # SSL/TLS parms.
  87. # See the server config file for more
  88. # description.  It's best to use
  89. # a separate .crt/.key file pair
  90. # for each client.  A single ca
  91. # file can be used for all clients.
  92. ca ca.crt
  93. cert client.crt
  94. key client.key
  95.  
  96.  
  97.  
  98. # Verify server certificate by checking that the
  99. # certicate has the correct key usage set.
  100. # This is an important precaution to protect against
  101. # a potential attack discussed here:
  102. #  http://openvpn.net/howto.html#mitm
  103. #
  104. # To use this feature, you will need to generate
  105. # your server certificates with the keyUsage set to
  106. #   digitalSignature, keyEncipherment
  107. # and the extendedKeyUsage to
  108. #   serverAuth
  109. # EasyRSA can do this for you.
  110. remote-cert-tls server
  111.  
  112. # If a tls-auth key is used on the server
  113. # then every client must also have the key.
  114. ;tls-auth ta.key 1
  115.  
  116. # Select a cryptographic cipher.
  117. # If the cipher option is used on the server
  118. # then you must also specify it here.
  119. cipher AES-128-CBC
  120. auth SHA256
  121. key-direction 1
  122.  
  123. # Enable compression on the VPN link.
  124. # Don't enable this unless it is also
  125. # enabled in the server config file.
  126. comp-lzo
  127.  
  128. # Set log file verbosity.
  129. verb 3
  130.  
  131. # Silence repeating messages
  132. ;mute 20
  133.  
  134.  
  135.  
  136. <ca>
  137. -----BEGIN CERTIFICATE-----
  138. CERTIFICATE PART REMOVED
  139. </tls-auth>
  140.    
  141. #################################################
  142. # Sample OpenVPN 2.0 config file for            #
  143. # multi-client server.                          #
  144. #                                               #
  145. # This file is for the server side              #
  146. # of a many-clients <-> one-server              #
  147. # OpenVPN configuration.                        #
  148. #                                               #
  149. # OpenVPN also supports                         #
  150. # single-machine <-> single-machine             #
  151. # configurations (See the Examples page         #
  152. # on the web site for more info).               #
  153. #                                               #
  154. # This config should work on Windows            #
  155. # or Linux/BSD systems.  Remember on            #
  156. # Windows to quote pathnames and use            #
  157. # double backslashes, e.g.:                     #
  158. # "C:\Program Files\OpenVPN\config\foo.key" #
  159. #                                               #
  160. # Comments are preceded with '#' or ';'         #
  161. #################################################
  162.  
  163. ##Auth
  164. comp-lzo
  165. #user nobody
  166. #group nogroup
  167. #client-to-client
  168. #client-cert-not-required
  169. username-as-common-name
  170.  
  171. ##user/pass auth from mysql
  172. plugin /usr/lib/openvpn/openvpn-auth-pam.so openvpn
  173.  
  174. ##script connect-disconnect
  175. script-security 3 system
  176. client-connect /etc/openvpn/scripts/connect.sh
  177. client-disconnect /etc/openvpn/scripts/disconnect.sh
  178.  
  179. ##management
  180. management localhost pw-management-file
  181.  
  182. keepalive 10 120
  183. persist-key
  184. persist-tun
  185. status status.log
  186. verb 4
  187.  
  188. # end code from 9-3-18
  189.  
  190. # Which local IP address should OpenVPN
  191. # listen on? (optional)
  192. ;local a.b.c.d
  193.  
  194. # Which TCP/UDP port should OpenVPN listen on?
  195. # If you want to run multiple OpenVPN instances
  196. # on the same machine, use a different port
  197. # number for each one.  You will need to
  198. # open up this port on your firewall.
  199. port 1194
  200.  
  201. # TCP or UDP server?
  202. ;proto tcp
  203. proto udp
  204.  
  205. # "dev tun" will create a routed IP tunnel,
  206. # "dev tap" will create an ethernet tunnel.
  207. # Use "dev tap0" if you are ethernet bridging
  208. # and have precreated a tap0 virtual interface
  209. # and bridged it with your ethernet interface.
  210. # If you want to control access policies
  211. # over the VPN, you must create firewall
  212. # rules for the the TUN/TAP interface.
  213. # On non-Windows systems, you can give
  214. # an explicit unit number, such as tun0.
  215. # On Windows, use "dev-node" for this.
  216. # On most systems, the VPN will not function
  217. # unless you partially or fully disable
  218. # the firewall for the TUN/TAP interface.
  219. ;dev tap
  220. dev tun
  221.  
  222. # Windows needs the TAP-Win32 adapter name
  223. # from the Network Connections panel if you
  224. # have more than one.  On XP SP2 or higher,
  225. # you may need to selectively disable the
  226. # Windows firewall for the TAP adapter.
  227. # Non-Windows systems usually don't need this.
  228. ;dev-node MyTap
  229.  
  230. # SSL/TLS root certificate (ca), certificate
  231. # (cert), and private key (key).  Each client
  232. # and the server must have their own cert and
  233. # key file.  The server and all clients will
  234. # use the same ca file.
  235. #
  236. # See the "easy-rsa" directory for a series
  237. # of scripts for generating RSA certificates
  238. # and private keys.  Remember to use
  239. # a unique Common Name for the server
  240. # and each of the client certificates.
  241. #
  242. # Any X509 key management system can be used.
  243. # OpenVPN can also use a PKCS #12 formatted key file
  244. # (see "pkcs12" directive in man page).
  245. ca ca.crt
  246. cert server.crt
  247. key server.key  # This file should be kept secret
  248.  
  249. # Diffie hellman parameters.
  250. # Generate your own with:
  251. #   openssl dhparam -out dh2048.pem 2048
  252. dh dh2048.pem
  253.  
  254. # Network topology
  255. # Should be subnet (addressing via IP)
  256. # unless Windows clients v2.0.9 and lower have to
  257. # be supported (then net30, i.e. a /30 per client)
  258. # Defaults to net30 (not recommended)
  259. ;topology subnet
  260.  
  261. # Configure server mode and supply a VPN subnet
  262. # for OpenVPN to draw client addresses from.
  263. # The server will take 10.8.0.1 for itself,
  264. # the rest will be made available to clients.
  265. # Each client will be able to reach the server
  266. # on 10.8.0.1. Comment this line out if you are
  267. # ethernet bridging. See the man page for more info.
  268. server 10.8.0.0 255.255.255.0
  269.  
  270. # Maintain a record of client <-> virtual IP address
  271. # associations in this file.  If OpenVPN goes down or
  272. # is restarted, reconnecting clients can be assigned
  273. # the same virtual IP address from the pool that was
  274. # previously assigned.
  275. ifconfig-pool-persist ipp.txt
  276.  
  277. # Configure server mode for ethernet bridging.
  278. # You must first use your OS's bridging capability
  279. # to bridge the TAP interface with the ethernet
  280. # NIC interface.  Then you must manually set the
  281. # IP/netmask on the bridge interface, here we
  282. # assume 10.8.0.4/255.255.255.0.  Finally we
  283. # must set aside an IP range in this subnet
  284. # (start=10.8.0.50 end=10.8.0.100) to allocate
  285. # to connecting clients.  Leave this line commented
  286. # out unless you are ethernet bridging.
  287. ;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
  288.  
  289. # Configure server mode for ethernet bridging
  290. # using a DHCP-proxy, where clients talk
  291. # to the OpenVPN server-side DHCP server
  292. # to receive their IP address allocation
  293. # and DNS server addresses.  You must first use
  294. # your OS's bridging capability to bridge the TAP
  295. # interface with the ethernet NIC interface.
  296. # Note: this mode only works on clients (such as
  297. # Windows), where the client-side TAP adapter is
  298. # bound to a DHCP client.
  299. ;server-bridge
  300.  
  301. # Push routes to the client to allow it
  302. # to reach other private subnets behind
  303. # the server.  Remember that these
  304. # private subnets will also need
  305. # to know to route the OpenVPN client
  306. # address pool (10.8.0.0/255.255.255.0)
  307. # back to the OpenVPN server.
  308. ;push "route 192.168.10.0 255.255.255.0"
  309. ;push "route 192.168.20.0 255.255.255.0"
  310.  
  311. # To assign specific IP addresses to specific
  312. # clients or if a connecting client has a private
  313. # subnet behind it that should also have VPN access,
  314. # use the subdirectory "ccd" for client-specific
  315. # configuration files (see man page for more info).
  316.  
  317. # EXAMPLE: Suppose the client
  318. # having the certificate common name "Thelonious"
  319. # also has a small subnet behind his connecting
  320. # machine, such as 192.168.40.128/255.255.255.248.
  321. # First, uncomment out these lines:
  322. ;client-config-dir ccd
  323. ;route 192.168.40.128 255.255.255.248
  324. # Then create a file ccd/Thelonious with this line:
  325. #   iroute 192.168.40.128 255.255.255.248
  326. # This will allow Thelonious' private subnet to
  327. # access the VPN.  This example will only work
  328. # if you are routing, not bridging, i.e. you are
  329. # using "dev tun" and "server" directives.
  330.  
  331. # EXAMPLE: Suppose you want to give
  332. # Thelonious a fixed VPN IP address of 10.9.0.1.
  333. # First uncomment out these lines:
  334. ;client-config-dir ccd
  335. ;route 10.9.0.0 255.255.255.252
  336. # Then add this line to ccd/Thelonious:
  337. #   ifconfig-push 10.9.0.1 10.9.0.2
  338.  
  339. # Suppose that you want to enable different
  340. # firewall access policies for different groups
  341. # of clients.  There are two methods:
  342. # (1) Run multiple OpenVPN daemons, one for each
  343. #     group, and firewall the TUN/TAP interface
  344. #     for each group/daemon appropriately.
  345. # (2) (Advanced) Create a script to dynamically
  346. #     modify the firewall in response to access
  347. #     from different clients.  See man
  348. #     page for more info on learn-address script.
  349. ;learn-address ./script
  350.  
  351. # If enabled, this directive will configure
  352. # all clients to redirect their default
  353. # network gateway through the VPN, causing
  354. # all IP traffic such as web browsing and
  355. # and DNS lookups to go through the VPN
  356. # (The OpenVPN server machine may need to NAT
  357. # or bridge the TUN/TAP interface to the internet
  358. # in order for this to work properly).
  359. push "redirect-gateway def1 bypass-dhcp"
  360.  
  361. # Certain Windows-specific network settings
  362. # can be pushed to clients, such as DNS
  363. # or WINS server addresses.  CAVEAT:
  364. # http://openvpn.net/faq.html#dhcpcaveats
  365. # The addresses below refer to the public
  366. # DNS servers provided by opendns.com.
  367. push "dhcp-option DNS 208.67.222.222"
  368. push "dhcp-option DNS 208.67.220.220"
  369.  
  370. # Uncomment this directive to allow different
  371. # clients to be able to "see" each other.
  372. # By default, clients will only see the server.
  373. # To force clients to only see the server, you
  374. # will also need to appropriately firewall the
  375. # server's TUN/TAP interface.
  376. client-to-client
  377.  
  378. # Uncomment this directive if multiple clients
  379. # might connect with the same certificate/key
  380. # files or common names.  This is recommended
  381. # only for testing purposes.  For production use,
  382. # each client should have its own certificate/key
  383. # pair.
  384. #
  385. # IF YOU HAVE NOT GENERATED INDIVIDUAL
  386. # CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
  387. # EACH HAVING ITS OWN UNIQUE "COMMON NAME",
  388. # UNCOMMENT THIS LINE OUT.
  389. ;duplicate-cn
  390.  
  391. # The keepalive directive causes ping-like
  392. # messages to be sent back and forth over
  393. # the link so that each side knows when
  394. # the other side has gone down.
  395. # Ping every 10 seconds, assume that remote
  396. # peer is down if no ping received during
  397. # a 120 second time period.
  398. keepalive 10 120
  399.  
  400. # For extra security beyond that provided
  401. # by SSL/TLS, create an "HMAC firewall"
  402. # to help block DoS attacks and UDP port flooding.
  403. #
  404. # Generate with:
  405. #   openvpn --genkey --secret ta.key
  406. #
  407. # The server and each client must have
  408. # a copy of this key.
  409. # The second parameter should be '0'
  410. # on the server and '1' on the clients.
  411. tls-auth ta.key 0 # This file is secret
  412. key-direction 0
  413.  
  414. # Select a cryptographic cipher.
  415. # This config item must be copied to
  416. # the client config file as well.
  417. ;cipher BF-CBC        # Blowfish (default)
  418. cipher AES-128-CBC   # AES
  419. auth SHA256
  420. ;cipher DES-EDE3-CBC  # Triple-DES
  421.  
  422. # Enable compression on the VPN link.
  423. # If you enable it here, you must also
  424. # enable it in the client config file.
  425. comp-lzo
  426.  
  427. # The maximum number of concurrently connected
  428. # clients we want to allow.
  429. ;max-clients 100
  430.  
  431. # It's a good idea to reduce the OpenVPN
  432. # daemon's privileges after initialization.
  433. #
  434. # You can uncomment this out on
  435. # non-Windows systems.
  436. user nobody
  437. group nogroup
  438.  
  439. # The persist options will try to avoid
  440. # accessing certain resources on restart
  441. # that may no longer be accessible because
  442. # of the privilege downgrade.
  443. persist-key
  444. persist-tun
  445.  
  446. # Output a short status file showing
  447. # current connections, truncated
  448. # and rewritten every minute.
  449. status openvpn-status.log
  450.  
  451. # By default, log messages will go to the syslog (or
  452. # on Windows, if running as a service, they will go to
  453. # the "Program FilesOpenVPNlog" directory).
  454. # Use log or log-append to override this default.
  455. # "log" will truncate the log file on OpenVPN startup,
  456. # while "log-append" will append to it.  Use one
  457. # or the other (but not both).
  458. ;log         openvpn.log
  459. ;log-append  openvpn.log
  460.  
  461. # Set the appropriate level of log
  462. # file verbosity.
  463. #
  464. # 0 is silent, except for fatal errors
  465. # 4 is reasonable for general usage
  466. # 5 and 6 can help to debug connection problems
  467. # 9 is extremely verbose
  468. verb 3
  469.  
  470. # Silence repeating messages.  At most 20
  471. # sequential messages of the same message
  472. # category will be output to the log.
  473. ;mute 20
  474.  
  475. # auth-user-pass-verify curlAuth.sh via-file
  476. # need auth here to use the script to authenticate
  477.    
  478. #!/bin/bash
  479. ##Dababase Server
  480. HOST='127.0.0.1'
  481. #Default port = 3306
  482. PORT='3306'
  483. #Username
  484. USER='openvpn'
  485. #Password
  486. PASS='lNPg5TAIy82zFpEn'
  487. #database name
  488. DB='openvpn'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top