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
Good article with a great overview.Very well and simply explained.Each of these points is important for realistic information.I appreciate your work here.
ReplyDeleteThanks for sharing this.
canada vpn
Great info!
ReplyDeleteThank you!
Thank U! Good article I was looking for...
ReplyDeleteGreat Work.........
ReplyDeletePreviously I tried different methods, refereed may articles.... but didn't work....
Your article is simple and clear... got my VPN connecvted in no-time..
Thanks,
DK
Cool work.Thanks for your job.
ReplyDeletetop10-bestvpn.com
Amazing post.Nice manual for VPN connection.
ReplyDeleteIt works excellent.Cool blog.
10webhostingservice.com
Such an amazing post on creating VPN Connection on Linux. Indeed, it was very helpful for me. Well, I also need to get best free vpn service for my phone as I usually access public wifi. Do you think Total VPN is a good free service?
ReplyDeleteThanks for Sharing Best VPN Provider
ReplyDeleteAwesome post.. I recommended you to use Fastest VPN which is best vpn service with highly-encrypted protocols there is ubuntu linux vpn tutorials.
ReplyDeleteFactually stated, about 75% of Devices are Operated using Windows. FastestVPN offers Best VPN for Windows for complete anonymity to the users of Windows.
ReplyDeleteCreating a VPN Connection is not a difficult task but here i learn many more things that how to setup free vpn for Linux thanks Sandeep Kapadane
ReplyDeleteFastestVPN offers Best VPN for Linux with an easy setup that lets you experience the internet with freedom, anonymity, security and privacy!
ReplyDeleteAmazing post.Nice manual for VPN connection.
ReplyDeleteIt works excellent. Cool blog also check this if you want free vpn italy