Projet

Général

Profil

OpenVPN » Historique » Version 9

Laurent GUERBY, 02/06/2012 18:12

1 3 Laurent GUERBY
{{>toc}}
2 3 Laurent GUERBY
3 1 Laurent GUERBY
h1. OpenVPN
4 1 Laurent GUERBY
5 3 Laurent GUERBY
h2. point a point
6 1 Laurent GUERBY
7 1 Laurent GUERBY
<pre>
8 1 Laurent GUERBY
openvpn --genkey --secret tst.key
9 1 Laurent GUERBY
10 1 Laurent GUERBY
#server
11 1 Laurent GUERBY
openvpn --mktun --dev-type tap --dev taptst
12 1 Laurent GUERBY
ip link set taptst up
13 1 Laurent GUERBY
openvpn --dev-type tap --dev tapstg --comp-lzo yes --cipher none --proto udp --daemon --keepalive 10 30 --secret tst.key --port 1234
14 1 Laurent GUERBY
15 1 Laurent GUERBY
#client
16 1 Laurent GUERBY
openvpn --mktun --dev-type tap --dev taptst
17 1 Laurent GUERBY
ip link set taptst up
18 1 Laurent GUERBY
openvpn --dev-type tap --dev tapstg --comp-lzo yes --cipher none --proto udp --daemon --keepalive 10 30 --secret tst.key --remote A.B.C.D 1234
19 1 Laurent GUERBY
</pre>
20 2 Laurent GUERBY
21 9 Laurent GUERBY
h2. Server
22 1 Laurent GUERBY
23 9 Laurent GUERBY
<pre>
24 9 Laurent GUERBY
# cat /etc/default/openvpn
25 9 Laurent GUERBY
...
26 9 Laurent GUERBY
AUTOSTART="ttnn-tap ttnn-tap6 ttnn-tap-tcp ttnn-tap-tcp6"
27 9 Laurent GUERBY
...
28 9 Laurent GUERBY
# cat /etc/openvpn/ttnn-tap.conf 
29 9 Laurent GUERBY
dev tap0udp
30 9 Laurent GUERBY
port 11195
31 9 Laurent GUERBY
proto udp
32 9 Laurent GUERBY
33 9 Laurent GUERBY
ca ttnn/ca.crt
34 9 Laurent GUERBY
cert ttnn/h1.crt
35 9 Laurent GUERBY
key ttnn/h1.key  # This file should be kept secret
36 9 Laurent GUERBY
dh ttnn/dh1024.pem
37 9 Laurent GUERBY
38 9 Laurent GUERBY
mode server
39 9 Laurent GUERBY
tls-server
40 9 Laurent GUERBY
41 9 Laurent GUERBY
persist-key
42 9 Laurent GUERBY
persist-tun
43 9 Laurent GUERBY
44 9 Laurent GUERBY
client-config-dir ccd
45 9 Laurent GUERBY
46 9 Laurent GUERBY
client-to-client
47 9 Laurent GUERBY
comp-lzo yes
48 9 Laurent GUERBY
keepalive 10 60
49 9 Laurent GUERBY
50 9 Laurent GUERBY
verb 3
51 9 Laurent GUERBY
log-append  log/openvpn-tap.log
52 9 Laurent GUERBY
status status/openvpn-tap.txt
53 9 Laurent GUERBY
54 9 Laurent GUERBY
# cat /etc/openvpn/ttnn-tap6.conf 
55 9 Laurent GUERBY
dev tap6udp
56 9 Laurent GUERBY
port 11196
57 9 Laurent GUERBY
proto udp6
58 9 Laurent GUERBY
59 9 Laurent GUERBY
ca ttnn/ca.crt
60 9 Laurent GUERBY
cert ttnn/h1.crt
61 9 Laurent GUERBY
key ttnn/h1.key  # This file should be kept secret
62 9 Laurent GUERBY
dh ttnn/dh1024.pem
63 9 Laurent GUERBY
64 9 Laurent GUERBY
mode server
65 9 Laurent GUERBY
tls-server
66 9 Laurent GUERBY
67 9 Laurent GUERBY
persist-key
68 9 Laurent GUERBY
persist-tun
69 9 Laurent GUERBY
70 9 Laurent GUERBY
client-config-dir ccd
71 9 Laurent GUERBY
72 9 Laurent GUERBY
client-to-client
73 9 Laurent GUERBY
comp-lzo yes
74 9 Laurent GUERBY
keepalive 10 60
75 9 Laurent GUERBY
76 9 Laurent GUERBY
verb 3
77 9 Laurent GUERBY
log-append  log/openvpn-tap6.log
78 9 Laurent GUERBY
status status/openvpn-tap6.txt
79 9 Laurent GUERBY
80 9 Laurent GUERBY
# cat /etc/openvpn/ttnn-tap-tcp.conf 
81 9 Laurent GUERBY
dev tap0tcp
82 9 Laurent GUERBY
port 443
83 9 Laurent GUERBY
proto tcp-server
84 9 Laurent GUERBY
85 9 Laurent GUERBY
ca ttnn/ca.crt
86 9 Laurent GUERBY
cert ttnn/h1.crt
87 9 Laurent GUERBY
key ttnn/h1.key  # This file should be kept secret
88 9 Laurent GUERBY
dh ttnn/dh1024.pem
89 9 Laurent GUERBY
90 9 Laurent GUERBY
mode server
91 9 Laurent GUERBY
tls-server
92 9 Laurent GUERBY
93 9 Laurent GUERBY
persist-key
94 9 Laurent GUERBY
persist-tun
95 9 Laurent GUERBY
96 9 Laurent GUERBY
client-config-dir ccd
97 9 Laurent GUERBY
98 9 Laurent GUERBY
client-to-client
99 9 Laurent GUERBY
comp-lzo yes
100 9 Laurent GUERBY
keepalive 10 60
101 9 Laurent GUERBY
102 9 Laurent GUERBY
verb 3
103 9 Laurent GUERBY
log-append  log/openvpn-tap-tcp.log
104 9 Laurent GUERBY
status status/openvpn-tap-tcp.txt
105 9 Laurent GUERBY
106 9 Laurent GUERBY
# keys generated with id ip-X-Y-Z-T, files:
107 9 Laurent GUERBY
# ip-91-224-149-165.crt
108 9 Laurent GUERBY
# ip-91-224-149-165.csr
109 9 Laurent GUERBY
# ip-91-224-149-165.key
110 9 Laurent GUERBY
111 9 Laurent GUERBY
# cat /etc/openvpn/ccd/ip-91-224-149-165
112 9 Laurent GUERBY
ifconfig-push 91.224.149.165 255.255.255.0
113 9 Laurent GUERBY
push "route-gateway 91.224.149.254"
114 9 Laurent GUERBY
push "redirect-gateway def1"
115 9 Laurent GUERBY
push "dhcp-option DNS 8.8.8.8"
116 9 Laurent GUERBY
117 9 Laurent GUERBY
# bridge
118 9 Laurent GUERBY
brctl addbr br0
119 9 Laurent GUERBY
brctl addif br0 eth0
120 9 Laurent GUERBY
ip link set br0 up
121 9 Laurent GUERBY
ip link set br0 address 52:54:10:00:00:11 #force MAC to avoid MAC changes
122 9 Laurent GUERBY
123 9 Laurent GUERBY
openvpn --mktun --dev tap0udp
124 9 Laurent GUERBY
openvpn --mktun --dev tap0tcp
125 9 Laurent GUERBY
openvpn --mktun --dev tap6udp
126 9 Laurent GUERBY
127 9 Laurent GUERBY
brctl addif br0 tap0udp
128 9 Laurent GUERBY
ip link set tap0udp up
129 9 Laurent GUERBY
130 9 Laurent GUERBY
brctl addif br0 tap0tcp
131 9 Laurent GUERBY
ip link set tap0tcp up
132 9 Laurent GUERBY
133 9 Laurent GUERBY
brctl addif br0 tap6udp
134 9 Laurent GUERBY
ip link set tap6udp up
135 9 Laurent GUERBY
136 9 Laurent GUERBY
</pre>
137 9 Laurent GUERBY
138 9 Laurent GUERBY
Pour ignorer les push IP et route du serveur coté client openvpn il suffit de mettre "tls-client" a la place de "client" l'option --client est un raccourci pour --tls-client  --pull et --pull est ce qui accepte les directives serveur.
139 3 Laurent GUERBY
140 5 Jocelyn Dealande
h2. Point-à-point avec routage d'un bloc d'IP.
141 5 Jocelyn Dealande
142 8 Jocelyn Dealande
[[Partage ADSL OpenVPN]]
143 5 Jocelyn Dealande
144 3 Laurent GUERBY
h2. Proxmox
145 3 Laurent GUERBY
146 3 Laurent GUERBY
http://www.nedproductions.biz/wiki/configuring-a-proxmox-ve-2.x-cluster-running-over-an-openvpn-intranet
147 4 Laurent GUERBY
http://blog.developpeur-neurasthenique.fr/auto-hebergement-configurer-un-cluster-proxmox-2-sans-multicast.html