您的位置:首页 > 其它

移植PPP2.4.5到ARM上实现拨号

2017-01-06 16:03 337 查看

1、内核编译的时候,看到以下关于PPP的全部要选择如下:
  Device Drivers--->Network device support  --->
 
  │ │       <*>   PPP (point-to-point protocol) support                   │ │
 
  │ │       [*]     PPP multilink support (EXPERIMENTAL)                  │ │
 
  │ │       [*]     PPP filtering                                         │ │
 
  │ │       <*>     PPP support for async serial ports                    │ │
 
  │ │       <*>     PPP support for sync tty ports                        │ │
 
  │ │       <*>     PPP Deflate compression                               │ │
 
  │ │       <*>     PPP BSD-Compress compression                          │ │
 
  │ │       <*>     PPP over Ethernet (EXPERIMENTAL)                      

 
1、移植pppd:
   1)从网上下载pppd源代码:ppp-2.4.3.tar.gz 源码包。tar -zvxf ppp-2.4.3.tar.gz 解压。
      网址:ftp://ftp.samba.org/pub/ppp/
   2)通过./configure生成Makefile;进入pppd/Makefile文件,将下面一段话中的FILTER=y注视掉
      # Uncomment the next line to include support for PPP packet filtering.
      # This requires that the libpcap library and headers be installed
      # and that the kernel driver support PPP packet filtering.
      #FILTER=y
 
   3)make CC=arm-linux-uclibc-gcc 进行编译;
   4)对编译后的pppd在使用命令:arm-linux-uclibc-strip压缩一下。
   5)mkdir /usr/local/lib/pppd/2.4.3
      cd pppd/plugins
      cp minconn.so passprompt.so passwordfd.so winbind.so /usr/local/lib/pppd/2.4.3
      cd rp-pppoe
      cp rp-pppoe.so /usr/local/lib/pppd/2.4.3
      cp pppoe-discovery /usr/sbin
     
      cd ../pppoatm
      cp pppoatm.so /usr/local/lib/pppd/2.4.3
    
      cd ../radius
      cp radius.so radattr.so radrealms.so /usr/local/lib/pppd/2.4.3
 
      cd ../..
      cp pppd /usr/sbin
     
      cd ../pppstatus
      cp pppstatus /usr/sbin
 
      cd ../pppdump
      cp pppdump /usr/sbin
 
      cd ../chat
      cp chat /usr/sbin
 
      cd ../pppd
      mkdir /usr/local/include/pppd
     cp ccp.h chap-new.h ecp.h fsm.h ipcp.h ipxcp.h lcp.h magic.h md5.h patchlevel.h
        pathnames.h pppd.h upap.h eap.h md4.h chap_ms.h shal.h pppcrypt.h tdb.h spinlock.h

         /usr/local/include/pppd/
 
      cd ../etc.ppp
      mkdir /etc/ppp
      cp chap-secrets options pap-secrets /etc/ppp
    6)在开发板上运行pppd,当有乱码输出时,移植成功。
 
3、移植pppoe:
   1)从网上下载pppoe源代码:pppoe-3.8-1.1.tar.gz 源码包。tar -zvxf pppoe-3.8-1.1.tar.gz 解压。
      网址:http://packages.debian.org/stable/source/rp-pppoe
   2)进入rp-pppoe-3.8/src目录,通过./configure生成Makefile;打开Makefile文件,
     把所有的gcc 和 ar 换成 arm-linux-uclibc-gcc 和 arm-linux-uclibc-ar,
     进入libevent目录,打开Makefile,把所有的gcc换成arm-linux-uclibc-gcc,
   3)回到rp-pppoe-3.8/src目录下,运行make 进行编译。
   4)回到rp-pppoe-3.8目录下,进入gui目录下打开Makefile文件。
   5)把所有的gcc 换成 arm-linux-uclibc-gcc。
   6)运行make进行编译。
   7)cd ../src
      cp pppoe /usr/sbin
      cp pppoe-server /usr/sbin
      cp pppoe-relay /usr/sbin
      cp pppoe-sniff /usr/sbin
     
      cd ../scripts
      cp pppoe-connect /usr/sbin
      cp pppoe-start /usr/sbin
      cp pppoe-status /usr/sbin
      cp pppoe-stop /usr/sbin
      cp pppoe-setup /usr/sbin
     
      chmod 755 /usr/sbin/pppoe-conndect
      chmod 755 /usr/sbin/pppoe-start
      chmod 755 /usr/sbin/pppoe-status
      chmod 755 /usr/sbin/pppoe-stop
      chmod 755 /usr/sbin/pppoe-setup
    
      cd ../gui
      cp pppoe-wrapper /usr/sbin
     
      cd ../configs
      mkdir /etc/ppp
      cp pppoe.conf /etc/ppp
      cp firewall-standaone /etc/ppp
      cp firewall-masq /etc/ppp
      cp pppoe-server-options /etc/ppp
      cp pap-secrets /etc/ppp
   8)这时可执行 sh#pppoe-setup 进入配置
     #/usr/sbin/pppoe-setup
     当出现>>> 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 重新输入。
   9)这时就可以启动pppoe客户端软件,进行联接。
      #usr/sbin/pppoe-start
       ........
       connected!
      表示联接成功:
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: