Advertisement
Guest User

OpenVPN Config - Raspberry Pi

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