Beeline internet Ubuntu Linux: различия между версиями
Внешний вид
Glorin (обсуждение | вклад) Нет описания правки |
Glorin (обсуждение | вклад) Нет описания правки |
||
| Строка 1: | Строка 1: | ||
Install xl2tpd (Layer 2 Tunneling Protocol (L2TP) daemon) | |||
# apt-get install xl2tpd | |||
/etc/xl2tpd/xl2tpd.conf | |||
[global] | |||
access control = yes | |||
[lac corbina] | |||
lns = tp.internet.beeline.ru | |||
redial = yes | |||
redial timeout = 1 | |||
require chap = yes | |||
require authentication = no | |||
name = 0892993954 | |||
ppp debug = yes | |||
pppoptfile = /etc/ppp/options.xl2tpd | |||
require pap = no | |||
autodial = yes | |||
tunnel rws = 8 | |||
tx bps = 100000000 | |||
/etc/ppp/ip-up.d/corbina | /etc/ppp/ip-up.d/corbina | ||
Версия от 17:16, 4 августа 2012
Install xl2tpd (Layer 2 Tunneling Protocol (L2TP) daemon)
# apt-get install xl2tpd
/etc/xl2tpd/xl2tpd.conf
[global] access control = yes [lac corbina] lns = tp.internet.beeline.ru redial = yes redial timeout = 1 require chap = yes require authentication = no name = 0892993954 ppp debug = yes pppoptfile = /etc/ppp/options.xl2tpd require pap = no autodial = yes tunnel rws = 8 tx bps = 100000000
/etc/ppp/ip-up.d/corbina
#!/bin/sh
#get default gw ip
BEELINEGWIP=`route -n | grep 'UG[ \t]' | awk '{print $2}' | tail -n 1`
#get and set routes for BEELINE DNS servers
DNS1=`grep nameserver /etc/resolv.conf | awk '{print $2}' | head -n 1`
DNS2=`grep nameserver /etc/resolv.conf | awk '{print $2}' | tail -n 1`
if [ "$DNS1" != "$DNS2" ]; then
ip route add $DNS1 via $BEELINEGWIP
ip route add $DNS2 via $BEELINEGWIP
else
ip route add $DNS1 via $BEELINEGWIP
fi
#get ips for tp.internet.beeline.ru, if going to loop comment elif
while true; do
IPS=`host tp.internet.beeline.ru | awk '{print $4}' | cut -d. -f1,2,3 | sort -u`
for IP in $IPS
do
if [ "$IP1" == "" ]; then
IP1=$IP
elif [ "$IP1" != "$IP" ] ; then
IP2=$IP
break 2
fi
done
sleep 1
done
#set routes for l2tp tunnel
if [ "$IP1" != "" ]; then
ip route add ${IP1}.0/24 via $BEELINEGWIP
fi
if [ "$IP2" != "" ]; then
ip route add ${IP2}.0/24 via $BEELINEGWIP
fi
#remove default routes
ip route del default
ip route del $5 dev $1