FreeBSD
1、安裝mpd(都說mpd對windows支持最好),很簡單
cd /usr/local/ports/net/mpd/
make all install clean
2、配置/usr/local/etc/mpd/mpd.conf
default:
load vpn
vpn:
load client1
#load client2
client1:
new -i ng0 pptp1 pptp1
set ipcp ranges x.x.x.x/32 y.y.y.y1/32
load pptp_def
client2:
new -i ng1 pptp2 pptp2
set ipcp ranges x.x.x.x/32 y.y.y.y2/32
load pptp_def
pptp_def:
set iface disable on-demand
set iface enable proxy-arp
set iface idle 1800
set bundle enable multilink
set link yes acfcomp protocomp
set link no pap chap
set link enable chap
set link keep-alive 10 60
set link mtu 1460
set ipcp yes vjcomp
set ipcp dns x.x.x.y
set bundle enable compression
set ccp yes mppc
set ccp yes mpp-e40
set ccp yes mpp-e128
set ccp yes mpp-stateless
open
3、配置/usr/local/etc/mpd/mpd.links
pptp1:
set link type pptp
set pptp self 對外提供vpn服務的ip
set pptp enable incoming
set pptp disable originate
pptp2:
set link type pptp
set pptp self 對外提供vpn服務的ip
set pptp enable incoming
set pptp disable originate
4、編寫啟動腳本/usr/local/etc/rc.d/mpd.sh
case $1 in
start)
[ -x /usr/local/sbin/mpd ] &&
[ -f "/usr/local/etc/mpd/mpd.conf" ] &&
/usr/local/sbin/mpd -b &&
echo -n ' mpd'
;;
stop)
killall mpd && echo -n ' mpd'
;;
*)
echo "Usage: `basename $0` {start|stop}" <&2
exit 64
;;
esac
exit 0
5、編輯用戶/口令文件 /usr/local/etc/mpd/mpd/secret 很簡單,照著例子作
好了,現在要做的事做完了。在winxp上創建一個vpn連接,ok,搞定。嘿嘿,還有2個非常重要的點,第一個要將freebsd服務器設置成路由模式也就是說在/etc/rc.conf中gateway_enable="YES" 要加上(網上找的資料都沒說著點,完全憑經驗),否則不能通過vpn服務器訪問內網的其他主機。第二,winxp的防火牆要關掉,為什麼不知道,總之不關,就會出現間歇性大量掉包