移植PPP2.4.5到ARM上實現撥號
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!
表示聯接成功: