Gentoo Wiki


This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc



The point of this HOW-TO is to explain how to dial-in to your internet provider using PPTP. This is usually the case with ADSL in certain European countries, most notably Austria. The reason for this how-to is that at the time of writing, the method of connecting to the internet using PPTP this way is not well documented in the Gentoo Network Configuration Guide nor in the /etc/conf.d/net.example.


This HOW-TO uses the sys-apps/baselayout-1.12.0-r1 and (probably) higher, net-dialup/ppp-2.4.3-r15, net-dialup/pptpclient-1.7.1, sys-apps/iproute2- and net-misc/dhcpcd-2.0.5


Note that the new baselayout changes how the network is configured. You might need to make substantial changes to your configuration. Now, if you want to continue, update to the new baselayout. Make sure you use etc-update or your personal favorite alternative to update all the config files. Then emerge ppp, pptpclient, iproute2 and dhcpcd.

We will be using dhcpcd instead of dhclient because I couldn't figure out how to prevent dhclient from setting a default route.


Refer to Gentoo Network Configuration for more information on how to configure your network and then use it together with the following to create your configuration:

File: /etc/conf.d/net
# Assume eth0 is the interface connected to the router
# and we set it up via DHCP. If you use eth1 substitute
# that in the rest of this file.
config_eth0=( "dhcp" )

# Use iproute2 instead of the default ifconfig
modules=( "iproute2"
          "dhcpcd" )

# Tell gentoo to set up the ppp interface
config_ppp0=( "ppp" )

# Set the route from the network card to the router. This
# could neccessary if the IP address acquired from DHCP
# is not on the same subnet as the router. Replace
# with the IP address supplied by your provider.

# routes_eth0=( "" )

# Make DHCP not set a default gateway. If it did, then
# ppp daemon wouldn't do it and all the data would go to your
# router instead of the pptp tunnel

# set up the link. note that the IP address is given by the
# provider and is identical to the one in the routes_eth0
# statement.
link_ppp0="pty 'pptp --nolaunchpppd'"

# Enter your username and password observing the apostrophe

# Add options. These ones shoul suffice. Debug can be 
# deactivated, but defaultroute should stay.
#       "updetach"      # WARNING: If you don't specify this then we will
                        # not wait for the actual PPP link to go up
        "debug"         # Enables syslog debugging
        "noauth"        # Do not require the peer to authenticate itself
        "defaultroute"  # Make this PPP interface the default route
        "lcp-echo-interval 15"  # Send a LCP echo every 15 seconds
        "lcp-echo-failure 3"    # Make peer dead after 3 seconds of in-activity

# eth0 should start before
depend_ppp0() {
       need net.eth0

Now tell Gentoo about the new interface:

Code: Symlinking net.ppp0 to net.lo
cd /etc/init.d
ln -s net.lo net.ppp0

Also ensure that your firewall allows connections from eth0 (or whatever interface you connect your router to) to the router.


First restart the net.eth0 interface and see if it sets up properly. See if you can ping your router at (or whatever your provider supplied you with, i.e. the pptp ip_address statement from /etc/conf.d/net above).

If this works fine, run /etc/init.d/net.ppp0 start. That's it. Make sure you check in /var/log/messages or using ifconfig that everything went ok. ifconfig should now output an additional interface, namely ppp0, and you should be able to ping servers on the Internet.

Retrieved from ""

Last modified: Sun, 08 Jun 2008 04:51:00 +0000 Hits: 13,283