This article will explain how to setup a ppp network interface on Gentoo for a Windows Server Routing and Remote Access VPN connection.
This article assumes that you have open PPTP ports on the windows server, which are setup by default.
/etc/conf.d/net
This first step is to define your ppp interface in /etc/conf.d/net. This will involve a few lines:
config_ppp0=( "ppp" )
link_ppp0="pty 'pptp vpn.yourdomain.com --nolaunchpppd'"
username_ppp0='DOMAIN\username'
pppd_ppp0=(
"updetach"
"debug"
"remotename your-vpn-profile"
"file /etc/ppp/options.pptp"
)
routes_ppp0=( "192.168.1.0/24" );
The first change, vpn.yourdomain.com, needs to point to either the IP or FQDN of the Windows Server running the VPN you want to connect to.
The second change, DOMAIN\username, is the standard windows login notation for the user that you wish to dial in with. It’s important to note that in the conf.d/net file, this field does NOT require special characters escaped with a\. The chap_secrets file WILL require this.
The third change, your-vpn-profile, is a label that must match the chap_secrets file.
The forth change, 192.168.1.0/24, is the static route to the network that is behind the VPN. If you’re not the network admin for the windows server that you are connecting too this may be a little confusing. You can check out this post for instructions on how to figure that out.
/etc/ppp/options.pptp
Add the following lines:
require-mppe-128
lcp-echo-interval 15
lcp-echo-failure 3
/etc/ppp/chap-secrets
This is the place where we will define the passwords for our VPN connection.
# Secrets for authentication using CHAP
# client server secret IP addresses
DOMAIN\\username your-vpn-profile Pa\$\$word1 *
DOMAIN\\username will be changed to the same as you defined in /etc/conf.d/net with one important difference, ALL control characters MUST BE ESCAPED with \. In this example it requires two \’s between the domain and username.
your-vpn-profile must match the label you setup in /etc/conf.d/net.
Pa\$\$word1 is where you define the password for the VPN connection. Again, ALL control characters MUST BE ESCAPED. This string sends an actual password of Pa$$word1.
/etc/init.d/net.ppp0
Finally we’ll symlink net.lo to net.ppp0 to give us an init script to work with.
ln -s net.lo net.ppp0
Now if you wanted you can do:
rc-update add net.ppp0 default
To have the connection start on bootup.