Talk:PPTP

From Gentoo Wiki
Jump to: navigation, search
Note
This is a talk page. Please add newer comments below older ones, and sign your comments using four tildes (~~~~). When adding a new section (at the bottom of the page), please mark it as "open for discussion" by using {{talk|open}} so it will show up in the list of open discussions.

I have some content to propose for this page - sorry if I'm messing up the etiquette, but I didn't want to take it upon myself to overwrite someone's existing text (plus I'm a Wiki neophyte and could use some aid in getting it formatted appropriately). Note: the existing page lists a bunch of PPP kernel options that can come into play for other PPP-based interface types, but many of them aren't necessary for PPTP. What's below is correct AFAIK (although the pppd ebuild warns about those other kernel options because it is, IMHO, a bit overzealous). I should also mention that I'm assuming MPPE support is desired, as it seems pretty much required due to the pervasiveness of M$'s influence on PPTP.

Because Gentoo's built-in networking system, or more accurately, OpenRC's, can handle most of the work for you, a PPTP client is very easy to setup. For this example, we'll assume you wish to configure an interface named "ppp0". You can use a different number if you wish, or even set up multiple PPTP interfaces with different numbers.

First, the only kernel params you really need for PPTP w/ MPPE are:

   CONFIG_PPP
   CONFIG_PPP_ASYNC
   CONFIG_PPP_MPPE

Then configure networking: Create /etc/conf.d/net.ppp0 (this is all pretty clear in /usr/share/doc/openrc-*/net.example.bz2):

   link_ppp0='pty "pptp vpn.domain.com --nolaunchpppd"' # VPN server hostname or IP address works fine.
   username_ppp0="your_pptp_username"
   password_ppp0="your_pptp_password"
   routes_ppp0="10.0.0.0/8 dev ppp0"  # Or whatever the remote network is.
   pppd_ppp0="persist updetach lcp-echo-interval 15 lcp-echo-failure 2"  # Not necessary, just my suggested options.

Note: many recipes that can be found around the web for setting up PPTP, even ones specifically written for Gentoo, state that you need a script to setup routes. You don't. The routing configuration above sets up Gentoo's/OpenRC's built-in route handling.

Create the initscript symlink and install the client software:

   # ln -s net.lo /etc/init.d/net.ppp0
   # emerge pptpclient

If you're like me, and don't like having your PPTP password in /etc/conf.d/net, which is world-readable by default, you can simply omit the password line there and instead put it in /etc/ppp/chap-secrets:

   your_pptp_username * "your_pptp_password" *

That's it. Your PPTP tunnel is completely configured "the Gentoo Way", and is managed by Gentoo's networking system exactly like any other interface (you can bring it up with "/etc/init.d/net.ppp0 start", add it to runlevels, etc.).

Mikenerone (talk) 07:54, 27 July 2014 (UTC)