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