Advertisement
Guest User

Untitled

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