delphij's Chaos

选择chaos这个词是因为~~实在很难找到一个更合适的词来形容这儿了……

08 Feb 2004

How to dial PPTP vpn from a FreeBSD box?

This is useful when you want to connect remote “Local” network through a PPTP vpn. First, install the ports/net/pptpclient, by doing:

cd /usr/ports/net/pptpclient
make all install clean && rehash

The next step is to set it up.

cd /etc/ppp
mv ppp.conf ppp.conf.original
cp usr/local/share/examples/pptpclient/ppp.conf .
chmod 640 ppp.conf

vi ppp.conf

Please note that the suggested steps above will remove all your existing ppp configurations.

Here we do some initial setup:

VPN:
set authname [Your username here]
set authkey [Your password here]
set timeout 0
set ifaddr 0 0
add [Destination address here] HISADDR
alias enable yes

Please note that if your VPN connects to many places, you can add more add [foo] HISADDR here. When VPN is dialed up, HISADDR is replaced with PPP protocol with the remote gateway(typically, the server) address.

Then it will be possible to pptp [VPN Server] VPN. Enjoy!

Note that if your case is to replace the default gateway, you must manually have VPN server route set.