rpm -qa | grep re-pppoe
如果有,就要卸载(原又的只适合在图形界面下运行)
rpm -e re-pppoe
3.安装re-pppoe
A.用RPM安装re-pppoe
如果下载的是SRPM文件,必须先编译,再安装.如下载到re-pppoe-3.5-1.src.rpm为例,介绍安装.
1.编译SRPM
rpm --rebuild re-pppoe-3.5-1.src.rpm (Red Hat 7.3以前的版本使用)
rpmbuild --rebuild re-pppoe-3.5-1.src.rpm (Red Hat 8.0以后的版本使用)
2.安装re-pppoe
cd /usr/src/redhat/RPMS/i386
rpm -ivh re-pppoe-3.5-1.i386.rpm
安装完毕后,会在/usr/sbin中添加adsl-start,adsl-stop,adsl-setup,adsl-status等文件,而配置文件在/etc/ppp中.
B.用Tarball安装re-pppoe
由于RPM有包的依赖性问题,如果不能安装re-pppoe,那么就直接使用Tarball方式来安装.如果下载到的包为re-pppoe-3.5.tar.gz.
1.解压缩
mv re-pppoe-3.5.tar.gz. /usr/local/src
cd /usr/local/src
tar -zxvf re-pppoe-3.5.tar.gz
2.检测系统与编译执行文件
cd re-pppoe-3.5/src
./configure --prefix=/usr/local
make;make install
4.设置re-pppoe
设置很简单,一般只要通过/usr/bin/adsl-setup就可以了.(Tarball安装的在/usr/local/sbin/adsl-setup)
/usr/bin/adsl-setup
1.输入ADSL帐号:
>>>Enter you PPPoE user name(defaule ):
2.使用什么设备连网
(default eth0):eth0
3.这里不用设置
>>>Enter the demand value (default no): <===直接按Enter
4.输入常用的DNS主机
>>>Enter the DNS information here:
>>>Enter the secondary DNS server address here:
5.输入ADSL密码,输入两次
>>>please enter you PPPoe password:
>>>please re-enter you PPPoe passsword:
6.输入防火墙的形式,输入0就是不设置防火墙
>>>choose a type of firewall(0-2):0
7.开机自动启动ADSL,输入yes
Do you want to start this connection at boot time?
please enter on or yes.
yes <===输入yes
8.看您设置的配置文件,如果没有问题,输入y就可以完成设置了
>>>Accpet these settings and adjust configuration files(y/n)?y
5.ADSL拨号上网
直接输入adsl-start就可以了
6.查看IP地址
ifconfig ppp0
7.自动检测ppp0的拨号状态
如果掉线后无法自动拨号,可以在/etc/corntab加入这一行
vi /etc/corntab
01-59/3 * * * * root /usr/sbin/adsl-start > /dev/null 2>&1