- 论坛徽章:
- 0
|
配置ADSL:
# vi /etc/ppp/ppp.conf
==========ppp.conf==========
default:
set log Phase Chat IPCP CCP tun command
set device /dev/cua01
set redial 15 0
set reconnect 15 10000
pppoe:
set device "!/usr/sbin/pppoe -i rl0"
disable acfcomp protocomp
deny acfcomp
set mtu max 1492
set crtscts off
set speed sync
enable lqr
set lqrperiod 5
set cd 5
set dial
set login
set timeout 0
set authname "sjz1231231@adsl2"
set authkey 242421
add! default HISADDR
enable mssfixup
==========ppp.conf==========
设置开机启动ADSL拨号:
# mkdir /etc/rc.d
# vi /etc/rc.d/adsl.sh
--------------+----------------+---------------
#!/bin/sh
# /etc/rc.d/adsl.sh
# 7-11-2004
# llzqq@126.com
pppoe_status () {
IP=$(/sbin/ifconfig tun0 | awk '/netmask/{print $2}')
if [ ! -z "$IP" ]; then
echo "pppoe link is up, ip: " $IP
else
echo "pppoe link is down"
fi
}
pppoe_start () {
echo -n "starting pppoe "; ppp -ddial pppoe > /dev/null
for i in 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0; do
sleep 2; echo -n "."
IP=$(/sbin/ifconfig tun0 | awk '/netmask/{print $2}')
if [ ! -z "$IP" ]; then
break
fi
done
echo "."
pppoe_status
}
pppoe_stop () {
PID=$(ps aux | awk '/ppp -ddial/{print $2}')
kill $PID
echo "pppoe link is down"
}
case "$1" in
'start')
pppoe_start
;;
'stop')
pppoe_stop
;;
'status')
pppoe_status
;;
*)
echo "Usage: $0 {start|stop|status}"
exit 1
esac
--------------+----------------+---------------
# chmod 555 /etc/rc.d/adsl.sh
开机时自动进行ADSL拨号
# vi /etc/rc.local
if [ -f /etc/ppp/ppp.conf ]; then
. /etc/rc.d/adsl.sh start
fi
# vi /etc/rc.shutdown
/etc/rc.d/adsl.sh stop
[ 本帖最后由 llzqq 于 2008-3-13 11:22 编辑 ] |
|