Install mpd5 pptp server on FreeBSD 9.2 and FreeBSD10

MPD ( Is a netgraph( based implementation of the multi-link PPP protocol for FreeBSD. 
If you want know more about mpd, you may visit mpd official site. 

I will introduce you how to setup pptp server with mpd on freebsd.

Pre Requirement

  1. FreeBSD 9.2 installed
  2. KVM based vps or dedicted server with FreeBSD 9.2
  3. you may know how to login ssh to configure your vps or server box.
  4. you may know how to compile software via freebsd ports
  5. you may know how to search the answer via Google (


replace your IP with


cd /usr/ports/net/mpd5make configmake install clean

2. enable boot configure at the rc.conf

add this lines append to /etc/rc.conf


gateway must enable for pptp, or you may failed to surfing the web

3. check ip forwarding

sysctl -a | grep ip.forwarding

if not 1, you may set it with:

sysctl net.inet.ip.forwarding=1

4. configure the mpd

cd /usr/local/etc/mpd5
create file named mpd.conf

startup:    set user netroby password admin    set console self 5005    set console open    set web self 5006    set web opendefault:    load pptp_serverpptp_server:    set ippool add pool1    create bundle template B    set iface enable proxy-arp    set iface idle 1800    set iface enable tcpmssfix    set iface route    set ipcp yes vjcomp    set ipcp ranges ippool pool1    set ipcp dns    set ipcp dns    set ipcp nbns    set bundle enable compression    set ccp yes mppc    set mppc yes e40    set mppc yes e128    set mppc yes stateless    create link template L pptp    set link fsm-timeout 5    set link action bundle B    set link enable multilink    set link yes acfcomp protocomp    set link no pap chap eap chap-msv2    set link enable chap chap-msv2 eap    set link accept chap-msv2     set link keep-alive 10 60    set link mtu 1460    set pptp self    set link enable incoming

and create file mpd.secret 

netroby \"mypassword\"

mpd.secret file contains the pptp login information. username then password

5. add logging to syslog configure

add following lines to the end of /etc/syslog.conf

!mpd*.* /var/log/mpd.log!*

if the last line !* exists, just put 

!mpd*.* /var/log/mpd.log



6. configure the pf configure

my /etc/pf.conf

my_int = \"vtnet0\"internal_net = \"\"external_addr = \"\"nat on $my_int from $internal_net to any -> $external_addrset skip on loblock in log allpass in on $my_int proto tcp from any to any port 1723 keep statepass in on $my_int proto tcp from any to any port 22 keep statepass in on $my_int proto tcp from any to any port 80 keep statepass in on $my_int proto tcp from any to any port 443 keep statepass in quick on $my_int proto icmp all keep statepass in proto gre all keep statepass in from any to $internal_netpass in from $internal_net to anypass out proto { gre, tcp, udp, icmp } all keep state

the pf configure may be load on boot time. it enabled in with the internal ip range, 

7. reboot your vps

8. using your iphone or other vpn client to connect your pptp server

As the default configure as this tutorial, the pptp user name was netroby and the password is mypassword



Tested on FreeBSD 10.0

分类: 默认 标签: 发布于: 2013, 点击数: