viernes, 19 de agosto de 2011

How to install a free VPN service in Ubuntu. PacketiX VPN.

Hi all,

this guide is to explain how to install and configure a free VPN service in Ubuntu or any Linux distribution. The free VPN service is PacketiX.NET which servers are located in Japan. You can find more information about this service in http://www.packetix.net.

I can say that if you follow all these steps the configuration will be easy and you will have a VPN service, very useful nowadays.

To be easiest and to save time you should do all operations being superuser:

sudo su


Installation

1. Located into your home directory "/home/userX/" download the vpnclient file from the web.

wget -c http://packetix.net/en/special/files/vpn2_5350_en/vpnclient-5350a-rtm-en-linux-x86.tar.gz

2. To compile the files zlib, openssl, readline and ncurses are nedeed.

apt-get install zlib1g-dev libreadline5-dev

3. Extract and compile.

tar -xzvf vpnclient-5350a-rtm-en-linux-x86.tar.gz
cd vpnclient*
make


4. Start the VPN service.

./vpnclient start

Configuration of the VPN service

1. Open the configuration service.

./vpncmd

You will see:

vpncmd command - PacketiX VPN Command Line Management Utility
PacketiX VPN Command Line Management Utility (vpncmd command)
Version 2.20 Build 5350 (English)
Compiled Oct 9 2007 01:27:58 by yagi at ILC308
Copyright (C) 2004-2007 SoftEther Corporation. All Rights Reserved.

By using vpncmd program, the following can be achieved.

1. Management of VPN Server or VPN Bridge
2. Management of VPN Clinet
3. Use of VPN Tools (certificate creation and communication speed measurement)

Select 1, 2 or 3:


2. Select option 2 Management of VPN Clinet.

You will see:

Specify the host name or IP address of the computer that the destination VPN Client is operating on.
If nothing is input and Enter is pressed, connection will be made to localhost (this computer).
Input destination:


Type 'localhost'.

Input destination: localhost
Connected to VPN Client “localhost“.
VPN Client>


3. Configure your connection.

VPN Client>niccreate
NicCreate command – Create New Virtual Network Adapter
Virtual Network Adapter Name: 0
The command terminated normally.


Now lets configure our account and connection

VPN Client>niclist
NicList command – Get List of Virtual Network Adapters
Item |Value
—————————-+———————————–
Virtual Network Adapter Name|0
Status |Enabled
MAC Address |00AC9D035CF6
Version |Version 2.20 Build 5350 (English)
The command terminated normally.

VPN Client>accountcreate
AccountCreate command – Create New VPN Connection Setting
Name of VPN Connection Setting: VPN
Destination VPN Server Host Name and Port Number: public.softether.com:443
Destination Virtual HUB Name: PUBLIC
Connecting User Name: PUBLIC
Used Virtual Network Adapter Name: 0
The command terminated normally.

VPN Client>accountlist
AccountList command – Get List of VPN Connection Settings
Item |Value
—————————-+———————————————–
VPN Connection Setting Name |VPN
Status |Offline
VPN Server Address |public.softether.com (Direct TCP/IP Connection)
Virtual Network Adapter Name|0
The command terminated normally.

VPN Client>accountconnect
AccountConnect command – Start Connection to VPN Server using VPN Connection Setting
Name of VPN Connection Setting: VPN
The command terminated normally.


Wait for a while and list the account again.

VPN Client>accountlist
AccountList command – Get List of VPN Connection Settings
Item |Value
—————————-+———————————————–
VPN Connection Setting Name |VPN
Status |Connected
VPN Server Address |public.softether.com (Direct TCP/IP Connection)
Virtual Network Adapter Name|0
The command terminated normally.


Set this as default connection everytime vpnclient started.

VPN Client>AccountStartupSet
AccountStartupSet command – Set VPN Connection Setting as Startup Connection
Name of VPN Connection Setting: VPN
VPN Client>quit


4. Check for the connection:

ifconfig vpn_0

vpn_0 Link encap:Ethernet HWaddr 00:ac:9d:03:5c:f6
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1603 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:463867 (463.8 KB) TX bytes:0 (0.0 B)


Configuration of the routing tables

This part is to route the connection to packetix server through your default gateway (usually wlan0 gateway).

Route connection to packetix vpn (130.158.6.0/24) through main gateway (192.168.1.1).

route add -net 130.158.6.0/24 gw 192.168.1.1

Adquire an IP adress from VPN server using DHCP.

dhclient vpn_0

Route all output connections to VPN gw

ip route del default via 192.168.1.1
ip route add default via 10.0.0.1 dev vpn_0


Or only route specific destinations through VPN gw

ip route del default via 10.0.0.1 dev vpn_0
route add -net 216.152.78.0/24 gw 10.0.0.1

No hay comentarios:

Publicar un comentario