logo
FAQ            Outlook Express   VPN UNIX       WEBMONEY   

 

VPN UNIX?

1. pptpclient:

cd /usr/ports/net/pptpclient
make install clean

2. ppp.conf:

ee /etc/ppp/ppp.conf			
---------------------------			
tim:			
set authname LOGIN			
set authkey PASS			
set timeout 0			
set ifaddr 0 0			
add default HISADDR			
alias enable yes			
---------------------------			
chmod 600 /etc/ppp/ppp.conf			

3. rc.conf:

ee /etc/rc.conf	
դ defaultrouter="192.168.101.201"
դ
static_routes="pptp"
route_pptp="192.168.0.0/16 192.168.101.201"
vpn_enable="YES"			
(ͦ 192.168.101.201 - )

4. vpn.run:

ee /usr/local/etc/rc.d/vpn.run
---------------------------
#!/bin/sh
echo $$ >/var/run/vpn.pid
while true; do
/usr/local/sbin/pptp vpn.tim tim
sleep 5
done
---------------------------
chmod 755 /usr/local/etc/rc.d/vpn.run			

5. vpn.sh:

ee /usr/local/etc/rc.d/vpn.sh
---------------------------
#!/bin/sh
#
# PROVIDE: vpn
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: FreeBSD shutdown
vpn_enable=${vpn_enable-"NO"}
vpn_pidfile=${vpn_pidfile-"/var/run/vpn.pid"}
. /etc/rc.subr
name="vpn"
rcvar=`set_rcvar`
command="/usr/local/etc/rc.d/vpn.run"
load_rc_config $name
pidfile="${vpn_pidfile}"
start_cmd="echo -n \" ${name}\"; ${command} ${command_args} &"
stop_cmd="echo -n \" ${name}\"; kill `cat $vpn_pidfile` ; killall -9 pptp "
run_rc_command "$1"
---------------------------
chmod 755 /usr/local/etc/rc.d/vpn.sh			

6. դ :

shutdown -r now			
Φ
route delete default
route add 192.168.0.0/16 192.168.101.201
/usr/local/etc/rc.d/vpn.sh start			

7. צ צ :

/usr/local/etc/rc.d/vpn.sh stop			
MPD
# /usr/local/etc/mpd4/mpd.conf
default:
load tim
tim:
new -i ng0 vpn vpn
set iface disable on-demand
# set iface addrs 192.168.1.1 192.168.2.1
set iface idle 0
# set iface session 28800
# disconnect the client after 8 hours
set iface route 0.0.0.0/1
set iface route 128.0.0.0/1
set iface route default
set bundle disable multilink
set auth authname "prngvu"
set auth password "passpass"
set link yes acfcomp protocomp
set link no pap
set link accept chap
set link mtu 1460
set link yes no-orig-auth
# set link yes passive
# set link keep-alive 10 75
# set ipcp yes vjcomp
# set ipcp ranges 192.168.1.1/32 192.168.2.1/32
#
# The five lines below enable Microsoft Point-to-Point encryption
# (MPPE) using the ng_mppc(8) netgraph node type.
#
# set bundle enable compression
# set ccp yes mppc
# set ccp yes mpp-e40
# set ccp yes mpp-e128
# set bundle enable crypt-reqd
# set ccp yes mpp-stateless
open
# cat /usr/local/etc/mpd4/mpd.links
vpn:
set link type pptp
set pptp self 192.168.106.100
set pptp peer 192.168.1.8
# set pptp enable originate incoming outcall
set pptp enable originate outcall