]> git.openstreetmap.org Git - chef.git/blob - cookbooks/openvpn/templates/default/tunnel.conf.erb
Add basic infrastructure for wireguard tunnels
[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 # Run unprivileged
36 user nobody
37 group nogroup
38
39 # Reuse resources on restart to avoid privilege problems
40 persist-key
41 persist-tun
42
43 # Set log verbosity
44 verb 3