Pages

May 30, 2007

Configure openvpn easy way

Hi! In this tip I show you working config files for openvpn (Linux server and Linux client, it should works for other OS with minimal modification). However, it doesnt include keys and their generating ;-)

IP addreses are random, vpn is communicating through port udp/1194. Commented line is example of how to route other network through vpn.

Server side:
# cat /etc/openvpn/server.udp.1194.conf
local 196.166.66.66
port 1194
proto udp
dev tun
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key # This file should be kept secret
dh /etc/openvpn/keys/dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist /etc/openvpn/keys/ipp.txt
push "route 196.166.66.66 255.255.255.255 net_gateway"
push "route 196.166.66.0 255.255.255.0 vpn_gateway"
#push "route 192.168.1.0 255.255.255.0 vpn_gateway" #other network to route through vpn
keepalive 10 120
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
log /var/log/openvpn.log
verb 4

Client side:
# cat /etc/openvpn/client.conf
client
dev tun
proto udp
remote 196.166.66.66 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca config/ca.crt
cert config/dany.crt
key config/dany.key
comp-lzo
verb 3

No comments:

Post a Comment