Search Windows and Linux Networking

Showing posts with label VPN. Show all posts
Showing posts with label VPN. Show all posts

Thursday, July 7, 2011

Creating VPN Connection on Linux (Ubuntu) using command line (PPTP Client for windows VPN Server)

Creating VPN Connection on Linux (Ubuntu) using command line (PPTP Client for windows VPN Server)

Last time we see how to create vpn connection on Ubuntu using GUI. Now we create connection by manually editing required file and by executing commands

To successfully configure PPTP VPN Client we need:-
  • /etc/ppp/peers/myvpn (Suppose we have given name to tunnel or connection as myvpn for our identity purpose)
  • /etc/ppp/chap-secrets
  • Server name or ip address of vpn server.
  • User name and password to connect vpn server.
  • Most important pptp-linux package

Step to create VPN connection:-
  • Install Package 
  • Create tunnel file . for Eg. I have creating myvpn as a connection or tunnel name.
  • Povide authentication information in chap-secrets file
  • Dial connection
  • Add route
Install Package:-
# apt-get install pptp-linux

Create tunnel file:-
Open the terminal and Create new file and type following details in tunnel file please replace your tunnel file name, user name and server detail high lighted with Red color.

# vi /etc/ppp/peers/myvpn

remotename myvpn
linkname myvpn
ipparam myvpn
pty "pptp vpn.mycompany.com --nolaunchpppd"
name myvpnuser
usepeerdns
require-mppe
refuse-eap
noauth
file /etc/ppp/options.pptp

Provide Authentication details:-
Please change accordingly syntax is “username” “connation name” “User Password” “*”  in following file.

# vi /etc/ppp/chap-secrets

myvpnuser myvpn User@password *

Dial Connection:-
Now dial connection with following command in terminal

# pon myvpn nodetach

Add default Route:-
(every time you need to add this route after vpn connected or you need to crate script for that)
Now open other tab in terminal or other terminal type following command

# route add default ppp0

Check default route added successfully by typing following command

# route
And make sure that following route are show in result

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default             *                      0.0.0.0              U        0      0        0    ppp0

Now you are successfully connected to Windows VPN Server.
to disconnect connection simply press Ctrl+C in first terminal

Tuesday, July 5, 2011

Creating VPN Connection on Ubuntu (PPTP Client for Windows VPN Server)

Creating VPN Connection on Ubuntu (PPTP Client for Windows VPN Server)

To configure VPN Connection You should at least know name or IP address of VPN Server. user name and password to connect .

  • To configure VPN Connection on Ubuntu go to menu bar and select internet icon > VPN ConnectionConfigure VPN
  • This will open Network Connections windows. In VPN tab Select Add to add new VPN connection
  •  in new connection wizard Select VPN Connection Type as Point-to-Point Tunneling Protocol (PPTP) and Select Create button.
  •  In Next Windows type the name for connection for example your vpn.mycompany.com or anything for your identity. make sure you have uncheck at connect automatically option and available to all users option . In VPN Tab type IP address or DNS name of your VPN server in Gateway field. and type valid user name and password in user name and password filed to authenticate to VPN Server. live NT Domain name blank or time your domain name and then select Advanced button. 
  •  In  PPTP Advanced options windows make sure you have selected use point-to-point encryption (MPPE) and MSCHAP and then click OK.
 Now your vpn connection is created for connect to windows vpn server. Now close all the windows and go to menu bar and Select Internet Icon > VPN Connection > then select you just crated vpn connection by clicking on your connection name. it will attempt to connect your vpn server and ip you have enter valid Server information and user authountication it will be connected. you will see small lock on Internet Icon.