前期准备:ppp2.4.5,rp-pppoe3.10
将上述两个压缩文件放入U盘,然后挂载。
1、插入u盘到计算机,如果目前只插入了一个u盘而且你的硬盘不是scsi的硬盘接口的话,那它的硬件名称为:sda1。
2、在mnt目录下先建立一个usb的目录(如:[root@localhost root]# mkdir /mnt/usb)
3、挂载U盘:mount -t vfat /dev/sda1 /mnt/usb
4、卸载U盘:umount /mnt/usb
5、删除usb目录:rm -rf /mnt/usb
解压文件
#tar xvfz ppp2.4.5.tar.gz
#cp ppp2.4.5
编译
./configure
make
将/chat/chat、./pppd/pppd、./pppdump/pppdump、./pppstats/pppstats复制到/usr/sbin/目录。
解压文件
#tar xvfz rp-pppoe-3.10.tar.gz
#cd rp-pppoe-3.10
编译
./go
编译完成后会自动进入设置,设置方法如下:
当出现
>>> Enter your PPPoE user name :
输入ADSL帐号的用户名
当出现
>>> Enter the Ethernet interface connected to the ADSL modem
For Solaris, this is likely to be something like /dev/hme0.
For Linux, it will be ethn, where ‘n’ is a number.
(default eth0):
输入 eth0 ,这是ADSL相连的网卡的名字。
当出现
>>> Enter the demand value (default no):
输入 no
当出现
>>> Enter the DNS information here:
输入 server ,这表示使用ADSL拨号自动获得的DNS服务器IP地址
当出现
>>> Please enter your PPPoE password:
输入ADSL帐号的密码
当出现
>>> Choose a type of firewall (0-2):
输入 0 ,不使用防火墙
当出现
>>> Accept these settings and adjust configuration files (y/n)?
如果输入的信息正确,输入 y ,完成配置,否则,输入 n 重新输入。
当连接成功后,使用命令:
#ifconfig -a
在输出中应该含有关于 ppp0 的一堆信息,其中还绑定了 IP 地址,说明已经从拨号中获得了IP地址。
使用命令
#netstat -nr
查看路由表信息,这时的默认路由应该是上面获得的IP地址。如果没有默认路由,我们可以手动增加:
#route add default gw 上面获得的IP地址
ping www.baidu.com
pppoe-setup 设置
pppoe-start 联网
pppoe-stop 断开连接
pppoe-status 查看网络状态