Showing posts with label openvpn. Show all posts
Showing posts with label openvpn. Show all posts

Friday, October 17, 2008

Setup OpenVPN in Ubuntu

To get my work on time schedule, I must bring it as my homework. It is software development. For this purpose, I have to connect my office computer to home computer with VPN.
1st - ISP's Modem
Open firewall or port triggering: 1194 UDP
ThenVirtual Server, forward incoming connection 1194 port to my office computer's IP address.
2dn - Install OpenVPN
Office / Server: Ubuntu 8.04 (Hardy Heron) Server
Home / Client: Ubuntu 8.04 Desktop
Install openvpn in both computers:
sudo apt-get install openvpn
3rd - Configure the server: (see HOWTO for more)
cd /etc/openvpncp -r /usr/share/doc/openvpn/examples/easy-rsa/2.0/ ./easy-rsa/cd easy-rsa
(optionals)
nano ./vars
Change the values:
export KEY_COUNTRY=ID
export KEY_PROVINCE=KEPRIexport KEY_CITY=BATAMexport KEY_ORG="OpenVPN-TEST"
export KEY_EMAIL="eshabe@gimail.com"
(then):
source ./vars
./clean-all
./build-ca
Pay attention in “Common Name”. Example answer: "myfirstvpn"
./build-key-server server
Pay attention in...
“Common Name” - my answer is “server”
“Sign the certificate? [y/n]” - answer “y”
“1 out of 1 certificate requests certified, commit? [y/n]” - answer “y”
./build-key client1
./build-key client2
./build-key client3
./build-dh
Copy key files:
cd /etc/openvpn
cp easy-rsa/keys/server.crt .
cp easy-rsa/keys/server.key .
cp easy-rsa/keys/ca.crt .
cp easy-rsa/keys/dh1024.pem .
Copy example config file:
gunzip /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz
4th - Configure the client
Copy key files:
cd /etc/openvpn
scp eshabe@125.x.x.x:/etc/openvpn/easy-rsa/keys/client1.crt client.crt
scp eshabe@125.x.x.x:/etc/openvpn/easy-rsa/keys/client1.key client.key
scp eshabe@125.x.x.x:/etc/openvpn/easy-rsa/keys/ca.crt ca.crt
Copy example config file:
cp /usr/share/doc/openvpn/examples/sample-config-files/client.conf .
Edit config file:
nano client.conf
Change remote value:
remote 125.1.2.3 1194
5th - Try and activate
Try:
(server)
openvpn server.conf
(client)
openvpn client.conf
Yes!! openvpn is ready….
/etc/init.d/openvpn start