]> git.openstreetmap.org Git - chef.git/blob - cookbooks/openvpn/templates/default/tunnel.conf.erb
748f969934a84612427cb4b7fd7fcbbbc14f7293
[chef.git] / cookbooks / openvpn / templates / default / tunnel.conf.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 # Set the local port to use
4 port <%= @port %>
5
6 # Use UDP
7 proto udp
8
9 # Use routed IP tunnels
10 dev tun
11
12 # Use shared secret authentication
13 secret <%= @name %>.key
14
15 # Run in peer-to-peer mode
16 mode p2p
17 <% if @mode == "client" -%>
18
19 # Connect to the remote machine
20 remote <%= @peer[:host] %> <%= @peer[:port] %>
21 <% end -%>
22
23 # Configure interface and routing
24 ifconfig <%= @address %> <%= @peer[:address] %>
25 <% @peer[:networks].each do |network| -%>
26 route <%= network[:address] %> <%= network[:netmask] %>
27 <% end -%>
28
29 # Keepalive - check every 10 seconds and reset after 2 minutes
30 keepalive 10 120
31
32 # Use AES-128 as the cipher
33 cipher AES-128-CBC
34
35 # Enable compression
36 comp-lzo
37
38 # Run unprivileged
39 user nobody
40 group nogroup
41
42 # Reuse resources on restart to avoid privilege problems
43 persist-key
44 persist-tun
45
46 # Set log verbosity
47 verb 3