Skip to content
Nosce Te Ipsum
  • Home
  • About me
  • My COETAIL Blogs
    • Course 1
    • Course 2
    • Course 3
    • Course 4
  • Testimonials
    • Professional
    • Personal
Site Search

PPTP VPN config on Linux

  • March 26, 2011
  • by Muhammad
Share on Facebook
Facebook
Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin
Pin on Pinterest
Pinterest
Share on Reddit
Reddit
Email this to someone
email
Share on StumbleUpon
StumbleUpon
Digg this
Digg

apt-get install pptpd mc

Type ifconfig and inspect the “eth0” section to find out the IP address of your server [inet addr]

mc -e /etc/pptpd.conf
add two lines:
(Assuming that your internal network IP address is 10.5.1.xxx, geeks call this the 10.5.1.0/24 subnet).
(It is important to avoid using the 192.168.1.xxx subnet for your home because most hotels, Linksys boxes, Cisco boxes, TP-LINK and Trendnet default to 192.168.1.xxx
You cannot VPN from one 192.168.1.0/24 network into another 192.168.1.0/24 network)

localip 10.5.1.3 (this address should be your server’s IP address, [inet addr] when you type ifconfig, see above )
remoteip 10.5.1.241-246

Above configuration assigns 6 IP addresses for 6 roaming users to VPN into your home/corporate network simultaneously.

mc -e /etc/ppp/options

find the line that says ms-dns, modify the IP addresses to suit your local environment.
These two IP addresses should be the IP addresses of the DNS servers provided to you by your ISP or use your router if that does the DNS for your network.
The following examples are the OpenDNS servers which anyone can use.

ms-dns 208.67.222.222
ms-dns 208.67.220.220

Create user accounts and passwords for roaming/telecommuting users to access your VPN server (use strong passwords for security)

mc -e /etc/ppp/chap-secrets

e.g.
alice pptpd a-strong-password *
bob pptpd another-strong-password *

The trailing * means these users are allowed to come in from any IP address, if the telecommuter or branch office
has a static or fixed IP address and never roams, then you can replace the * with his/her fixed IP address (or IP address block) for added security.

You typically want to use a “static IP” address for VPN server behind firewall.

Change the Debian box from DHCP to static IP address:

mc -e /etc/network/interfaces

find the line that says iface eth0 inet dhcp
change the above line to iface eth0 inet static
add 4 lines below the iface eth0 inet static line, the actual addresses you use should be your own internal network environment.
address 10.5.1.3
netmask 255.255.255.0
broadcast 10.5.1.255
gateway 10.5.1.1

F2 to save the file, F10 to quit editing

mc -e /etc/resolv.conf
nameserver 216.21.128.22 (note: please use your ISP/cable/DSL company’s DNS servers)
nameserver 216.21.129.22
F2 to save the file, F10 to quit editing.

reboot

One final tweak is to instruct the Linux kernel to “forward” VPN packets.
mc -e /etc/sysctl.conf
fine the line that says:
#net.ipv4.conf.default.forwarding=1
delete the #
save the file.
reboot
With older kernels, you may need to add these (depreciated) steps:
touch /etc/init.d/pptp
chmod 755 /etc/init.d/pptp
mc -e /etc/init.d/pptp edit the file, add one line, save the file.
echo 1 > /proc/sys/net/ipv4/ip_forward

cd /etc/rcS.d
ln -s /etc/init.d/pptp S85-pptp-packet-forward
reboot

Share on Facebook
Facebook
Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin
Pin on Pinterest
Pinterest
Share on Reddit
Reddit
Email this to someone
email
Share on StumbleUpon
StumbleUpon
Digg this
Digg
Installing Kaltura on Debian Lenny
me and me ninja
Muhammad
linux pptp VPN

Related articles

Dynamic DNS client setup for…
Install Nginx, MySQL and PHP…
Attaching an external storage with…
Setting up L2TP/IPSEC server using…
(c) Raspberry Pi
Starting with Raspberry Pi
Using GeoIP database to identify…
…after a long absence
ISOLINUX: No DEFAULT or UI…
Installing and Running MinecraftEdu on…
clean mail queue with Perl…

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Follow Me!

Follow Me On TwitterFollow Me On LinkedInFollow Me On PinterestFollow Me On About.meFollow Me On Wordpress
May 2025
M T W T F S S
« Oct    
 1234
567891011
12131415161718
19202122232425
262728293031  

2009 2010 2011 Amelie apache beijing birthday clearos crèpes debian december 2009 dubai email february firewall guide holidays ill install internet kuala lumpur linux list mac maheen mobile october 2009 outlook Pakistan raspberry raspberry pi router search Sharepoint smtp snow spring ubuntu unix VLAN VPN windows 7 winter xian Zimbra

WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

Categories

Licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Theme by Colorlib Powered by WordPress
  • Home
  • About me
  • My COETAIL Blogs
  • Testimonials