Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3962593
  • 博文数量: 366
  • 博客积分: 9916
  • 博客等级: 中将
  • 技术积分: 7195
  • 用 户 组: 普通用户
  • 注册时间: 2011-05-29 23:27
个人简介

简单!

文章分类

全部博文(366)

文章存档

2013年(51)

2012年(269)

2011年(46)

分类: 嵌入式

2011-12-10 17:33:40

一:总的来说可以分四点

1arm linux 内核支持ppp

2: install  ppp-2.4.4 (rp-pppoeppp的支持才能正常运行)

3: install  rp-pppoe

4:把步骤(2)(3)中生成的相应文件下载到目标板,根据相应提示适当修改就行了。

二:需要的包

移植需要rp-pppoeppp。我用的是rp-pppoe3.10ppp-2.4.4的组合。

三:具体过程

1: 配置编译内核

 在内核原代码主目录下 make menuconfig

-> Device Drivers -> Network device support  -> PPP (point-to-point protocol)  中,选中所有ppp选项。退出,保存配置,重新执行make zImage.
arch/arm/boot/下的zImage下载到开发板上重启系统。

2:  install ppp-2.4.4

下载的是ppp-2.4.4.tar()解压。进入源码目录。执行./configure
完成后。执行make,这里要进行交叉编译。因此,我在这里指定CCarm gcc,整个命令为
make CC=arm-linux-gcc

(NOTE: 这里为你自己机子上的交叉编译器,根据具体名字而定)
编译完成后,进入pppd目录,将生成的pppd可执行文件拷贝到目标板文件/usr/sbin下。

3:install rp-pppoe3.10
下载rp-pppoe3.10()后,解压源码。进入源码目录。再进入src目录。
然后,要进行交叉编译。根据经验,使用./confiugre --host=arm-linux进行配置,但不能通过,confiuge执行后,报
checking for  2.6.X kernel-mode PPPoE support... cross-compiling, default:
no
checking packing order of bit fields... no defaults for cross-compiling
的错误,然后退出了confiugre程序。
configure
程序其实是一sh脚本,用编辑器打开,仔细查看后,原来此脚本根本没对cross_compiling提供支持,当检测到你要进行交叉编译后,就自动退出了。解决方法一是自已在脚本中加入相关代码,一是用./configure生成非交叉编译的makefile,然后再手工修改其中的gccarm-linux-gcc

第二种方法。执行./configure后,程序报生成两个makefile文件,一是在src 下的,一是在libevent下的。直接替换这两个makefile文件中的
编译完成后,src目录下会产生pppoepppoe-serverpppoe-sniffpppoe-relay。把这些程序下载到目标机/usr/sbin目录下。
复制配置
rp-pppoe-3.10/configs
目录下是rp-pppoe所需的配置文件,把这些文件全部复制到目标机的/etc/ppp目录下(没有就自己建一个)
相关的脚本程序共有6个,在rp-pppoe-3.10/scripts中。
pppoe-setup
:配置程序,把输入的帐号密码等信息存入配置文件。
pppoe-start
:拨号程序,连接网络。
pppoe-stop
:断开。
pppoe-status
:查看连接状态。
pppoe-connect
:连接网络,被pppoe-start所调用。
pppoe-init
:初始化,被其他程序调用。
把这些脚本也放到/usr/sbin目录下。

4: 在目标板上测试运行
试运行一下pppd,假如出现如下提示
pppd: pppd is unable to open the /dev/ppp device.
You need to create the /dev/ppp device node by
executing the following command as root:
mknod /dev/ppp c 108 0
那么就应该按照提示执行命令mknod /dev/ppp c 108 0,再运行一次pppd,假如有乱码出现就说明安装pppd成功了。
如果出现下面的信息。则说明你内核可能还不支持pppFix this according to the above
./pppd: This system lacks kernel support for PPP.  This could be because
the PPP kernel module could not be loaded, or because PPP was not
included in the kernel configuration.  If PPP was included as a
module, try `/sbin/modprobe -v ppp'.  If that fails, check that
ppp.o exists in /lib/modules/`uname -r`/net.
See README.linux file in the ppp distribution for more details

如果内核运行再执行pppd,等一会,出现乱码,说明pppd工作正常了

修改角本:pppoe-setup 将其中的将PPPD改为PPPD=/usr/sbin/pppd(就是你放pppd可执行程序的位置)不然会报错说找不到pppd,没有装.
执行pppoe-setup,根据提示输入拨号所需的参数(ISP提供的用记名和密码)。要确定rp- pppoe的配置文件所在的目录即/etc/ppp是可写的。否则,参数不能保存。

./pppoe-setup(下面是一些说明供参考)

>> Enter your PPPoE user name: ——此处输入拨号帐号的用户名 
>> 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(视情况而定

>> Enter the demand value (default no): ——
no 
>> Enter the DNS information here: ——
IP(eg:69.45.45.34)(视当地运营商的DNS服务器IP而定)

>> Please enter your PPPoE password: ——
输网通用户口令 
>> Choose a type of firewall (0-2): ——
0 (0为不要防火墙
)
>> Accept these settings and adjust configuration files (y/n)? ——
y

执行pppoe-start后。出现connected!的提示,说明ADSL已拨号成功,可以ping google看通不。


摘自 http://blog.chinaunix.net/space.php?uid=25100840&do=blog&id=1753478

阅读(1577) | 评论(0) | 转发(3) |
给主人留下些什么吧!~~