一、安装mpd5
root@localhost:/ # cd /usr/ports/net root@localhost:/usr/ports/net # cd mpd5 root@localhost:/usr/ports/net/mpd5 # make install clean
root@localhost:/usr/ports/net/mpd5 # ee /etc/rc.conf mpd_enable="YES"
二、配置PPTP ***
root@localhost:/usr/ports/net/mpd5 # cd /usr/local/etc/mpd5/ root@localhost:/usr/local/etc/mpd5 # cp mpd.conf.sample mpd.conf root@localhost:/usr/local/etc/mpd5 # ee mpd.conf startup: # configure mpd users set user admin #admin123# # configure the console set console self 127.0.0.1 5677 set console open # configure the web server set web self 0.0.0.0 5678 set web open default: load pptp_server #默认调用pptp_server模块 pptp_server: set ippool add pool1 192.168.1.20 192.168.1.30 #此处是配置***客户端分配的ip地址池 create bundle template B set iface enable proxy-arp set iface idle 1800 set iface enable tcpmssfix set iface route 192.168.1.254 #设置路由 set ipcp yes vjcomp set ipcp ranges 192.168.1.254/32 ippool pool1 #此处是配置***客户端分配的ip地址的网关 set ipcp dns 114.114.114.114 #设置 dns #set ipcp nbns 192.168.1.4 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 action bundle B set link enable multilink set link yes acfcomp protocomp set link no pap chap eap set link enable chap set link keep-alive 10 60 set link mtu 1460 set pptp self 10.10.10.128 #设置pptp的监听ip地址,也就是你的网卡的IP地址 set link enable incoming root@localhost:/usr/local/etc/mpd5 # ee /etc/rc.conf hostname="localhost" ifconfig_em0="inet 10.10.10.128 netmask 255.255.255.0" defaultrouter="10.10.10.1" local_unbound_enable="YES" sshd_enable="YES" moused_enable="YES" ntpd_enable="YES" powerd_enable="YES" # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable dumpdev="AUTO" zfs_enable="YES" mpd_enable="YES" gateway_enable="YES" natd_enable="YES" natd_interface="em0" firewall_enable="YES" firewall_type="OPEN" firewall_logging_enable="YES" root@localhost:/usr/local/etc/mpd5 # ee /etc/ipfw.rules ipfw add allow all from any to any ipfw add divert natd ip from any to any via em0 root@localhost:/usr/local/etc/mpd5 # /etc/rc.d/ipfw start root@localhost:/usr/local/etc/mpd5 # /usr/local/etc/rc.d/mpd5 start #启动mpd5 Starting mpd5 root@localhost:/usr/local/etc/mpd5 # sysctl -w net.inet.ip.forwarding=1 net.inet.ip.forwarding: 0 -> 1 root@localhost:/usr/local/etc/mpd5 # ee mpd.secret #添加用户名和密码 zhangbinguo $zhangbinguo$ root@localhost:/usr/local/etc/mpd5 # reboot
三、客户端配置方法(win7)
第一步:
第二步:
第三步:
第四步:
第五步:
第六步:
第七步:
第八步:
第九步:
转载于:https://blog.51cto.com/stuart/1775508