(ипшник 10.0.175.193 поменять на свой и заменить ИМЯ_ПОЛЬЗОВАТЕЛЯ и ПАРОЛЬ)
/etc/xl2tpd/xl2tpd.conf
- Код: Выделить всё
[global]
access control = no
auth file = /etc/ppp/chap-secrets
debug avp = no
debug network = no
debug packet = no
debug state = no
debug tunnel = no
[lac L2TP.freedom]
lns = l2tp.freedom
redial = yes
redial timeout = 5
require chap = yes
require authentication = no
name = icl2tp
ppp debug = no
pppoptfile = /etc/ppp/peers/freedom-l2tp
require pap = no
autodial = yes
/etc/ppp/peers/freedom-l2tp
- Код: Выделить всё
maxfail 0
lcp-echo-interval 120
lcp-echo-failure 10
defaultroute
user ИМЯ_ПОЛЬЗОВАТЕЛЯ
remotename PPTP
lock
noauth
ipparam icl2tp
deflate 15,15
mtu 1400
unit 5
logfile /var/log/pppd-connect-errors.log
default-asyncmap
ipcp-accept-local
ipcp-accept-remote
#debug
nodeflate
nobsdcomp
nopcomp
noaccomp
/etc/ppp/chap-secrets
- Код: Выделить всё
# Secrets for authentication using CHAP
# client server secret IP addresses
"ИМЯ_ПОЛЬЗОВАТЕЛЯ" * "ПАРОЛЬ" *
/etc/ppp/ip-up
- Код: Выделить всё
#!/bin/sh
LOG=/var/log/ip-scripts.log
CONN_NAME=$6
case $CONN_NAME in
icl2tp)
/sbin/route add -net 192.168.149.0/24 gw 10.0.175.193 1>>$LOG 2>>$LOG
/sbin/route add 195.98.64.92 gw 10.0.175.193 1>>$LOG 2>>$LOG
/sbin/route add 195.98.64.65 gw 10.0.175.193 1>>$LOG 2>>$LOG
/sbin/route add 195.98.64.66 gw 10.0.175.193 1>>$LOG 2>>$LOG
/sbin/route del default 1>>$LOG 2>>$LOG
GW=`/sbin/ifconfig ppp5|grep 'P-t-P' | cut -f 3 -d : | cut -f 1 -d \ `
echo "Gateway = $GW" 1>>$LOG 2>>$LOG
/sbin/route add default gw $GW 1>>$LOG 2>>$LOG
/sbin/route add -net 10.0.0.0/8 gw 10.0.175.193 1>>$LOG 2>>$LOG
# /bin/echo "nameserver 127.0.0.1" >/etc/resolv.conf 2>>$LOG
;;
*)
;;
esac
/etc/ppp/ip-down
- Код: Выделить всё
#!/bin/sh
LOG=/var/log/ip-scripts.log
CONN_NAME=$6
case $CONN_NAME in
icl2tp)
/sbin/route del -net 192.168.149.0/24 gw 10.0.175.193 1>>$LOG 2>>$LOG
/sbin/route del 195.98.64.92 gw 10.0.175.193 1>>$LOG 2>>$LOG
/sbin/route del 195.98.64.65 gw 10.0.175.193 1>>$LOG 2>>$LOG
/sbin/route del 195.98.64.66 gw 10.0.175.193 1>>$LOG 2>>$LOG
/sbin/route del -net 10.0.0.0/8 gw 10.0.175.193 1>>$LOG 2>>$LOG
# /sbin/route del default 1>>$LOG 2>>$LOG
/sbin/route add default gw 10.0.175.193 1>>$LOG 2>>$LOG
;;
*)
;;
esac
/etc/resolv.conf
- Код: Выделить всё
nameserver 195.98.64.65
nameserver 195.98.64.66