Thursday, July 7, 2011

Simple VPN installation on debian lenny

This is an simple way to install openvpn for two computer, one is the vpn-server, the other is the client.


First i install openvpn with aptitude:
aptitude install openvpn

After this i generate a secrec key with:
openvpn --genkey --secret static.key
it should be stored in /etc/openvpn direcotry.

now i modified the /etc/openvpn/server.conf that it looks like this:
dev tun
secret /etc/openvpn/static.key
push "route"
port 1234

I decieded for an other port because security reasons.
Now i must enable ip_forwarding with:
echo 1 > /proc/sys/net/ipv4/ip_forward

The kernel routing table looks like this:
Ziel Router Genmask Flags Metric Ref Use Iface UGH 0 0 0 tun0 UH 0 0 0 tun0 UG 0 0 0 eth0 U 0 0 0 eth0

Here is the ip-adress from the client behind the vpn and the ip of the vpn-server.


Here we install openvpn with:
aptitude install openvpn

The the /etc/openvpn/openvpn.conf
remote 1234
dev tun
secret /etc/openvpn/static.key

The ip adress is the fix-internetadress of the vpn server,
this one you must know.
1234 is the port where openvpn is listening.
You must transfer the static.key on a secure way to the client pc and store it
in /etc/openvpn directory

The kernel-routing table should look like this:
Ziel Router Genmask Flags Metric Ref Use Iface 0 UH 0 0 0 tun0 U 0 0 0 eth0 UG 0 0 0 eth0

No comments:

Post a Comment