Thursday, May 15, 2008

Setting up a VPN server on FreeBSD in 10 minutes

install pptpd server:

#cd /usr/ports/net/poptop ; make install clean

that's all folks !

Configure pptpd server

in /usr/local/etc/pptpd.conf add :

localip 192.168.100.1 # server local address
remoteip 192.168.100.100-200 # remote adresses (clients)

in /etc/ppp/ppp.conf :

pptp:
set ifaddr 192.168.100.1 \
\ 192.168.100.100-192.168.100.200 255.255.255.255
set dns 192.168.100.1
set nbns 192.168.100.1
disable pap
disable utmp
disable passwdauth
enable MSChapV2
enable mppe
set log Phase Chat LCP IPCP CCP tun command
set timeout 0
set mppe 128 stateless
disable deflate pred1
deny deflate pred1
set server /var/run/pptp_ppp_%d "" 0700
accept dns
disable ipv6cp
enable proxy

edit /etc/ppp/ppp.secret like that :


username userpass ipaddress
# ipaddress isn't mandatory

then check you have in /etc/rc.conf :


gateway_enable="YES"
arpproxy_all="YES"

start PPTPD server :


# /usr/local/etc/rc.d/pptpd start

then check it is running :


# netstat -a -n
tcp 0 0 0.0.0.0:1723 0.0.0.0:* LISTEN

DONE.

No comments: