OpenVPN

[ Serveurs - Configuration - Openvpn ]

Exemple de configuration en NAT utilisant les clefs d'authentification

Serveur

port 1194
proto tcp
dev tun
ca ca.crt
cert server.crt
key server.key  # This file should be kept secret
dh dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS 208.67.220.220"
keepalive 10 120
cipher AES-128-CBC   # AES
comp-lzo
max-clients 30
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn-status.log
log-append  /var/log/openvpn.log
verb 4
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to xx.xx.xx.xx --source 10.8.0.0/24

Client

client
dev tun
proto tcp
remote monserveur.com 1194
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
ca ca.crt
certclient.crt
key client.key
cipher AES-128-CBC
comp-lzo
verb 4
log /var/log/openvpn.log 
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
route add -net 192.168.1.0 gw 192.168.1.1 netmask 255.255.255.0
Creative Commons License