歡迎您光臨本站 註冊首頁

在LINUX (Mandrake 7.0)下安裝ADSL

←手機掃碼閱讀     火星人 @ 2014-03-12 , reply:0
  環境
系統:Linux Mandrake release 7.1 (helium) Kernel 2.2.15-4mdk on an i686
ADSL客戶端設備:ANT:Alcatel A1000 10/100baseT 介面的網橋;
NIC:TP-Link 8139B 10/100M網卡。
ANT與NIC用一對一五類雙絞線連接。
沒有固定IP地址,有局端動態分配。
所需軟體包:pppoed-0.48b1.tgz,可在http://www.davin.ottawa.on.ca/pppoe/得到。

一、網卡設置
先安裝一塊網卡,並配置好網卡的參數(相關配置手冊)。如我的網卡IP為192.168.0.8。
二、安裝PPPOED軟體包
在安裝好系統后,系統會預設安裝PPP軟體,並在/usr/sbin下生成pppd,pppstats等文件,故不用安裝PPP軟體包了。
將下載的軟體包pppoed-0.48b1.tgz解壓到/usr/src/pppoed-0.48b1目錄下:
# tar ?zxvf pppoed-0.48b1.tgz
進入該目錄,並運行命令:
#Install_pppoed
出現以下提示,根據提示進行安裝如下:
Linux source directory[where kernel headers are found] [/usr/src/linux]:
(原碼路徑)(按回車)
Module install dir [/lib/modules/2.2.15-4mdk/net]:
(模塊安裝路徑)(按回車)
RH-like init directory [/etc/rc.d/init.d]: 初始化路徑)(按回車)
compiler for modules. If you have RH7.0, select kgcc instead of gcc
[gcc]:(編譯時所需的
C環境,Mandrake 7.0下,是用gcc)(按回車)

Kernel source: /usr/src/linux
init_dir: /etc/rc.d/init.d
module install directory: /lib/modules/2.2.15-4mdk/net
Compiler for modules : gcc
is this correct?(answer y/n only)
[y]:(詢問以上設置是否正確,如果正確就按y)
然後就進行編譯過程。編譯完后出現以下提示:
Do you want me to setup PPP for you?(answer y/n only)
[y]:(是否要設置PPP)(按回車)
Please enter your Username for your ISP [ ]: (輸入用戶名)(如 abc)
Please enter your Password for your ISP [ ]:(輸入你的密碼)
Please enter your domain name
This is often trailing the @ in your email address
If your email was John@Doe.com, then most often, your
domain name would be: Doe.com
domain name : [ ]: (輸入你的域)(如我的是163.gd)

collected information

User Name : szourweb
passWord: ourweb
domainName: 163.gd
is this correct?(answer y/n only) [y]:
(確認你的信息是否正確,如果正確就按回車)
setting ppp-options ....
Setting /etc/ppp/pap-secrets* perms to 600

Do you want me to setup DNS for you?(answer y/n only)
[y]:(是否設置DNS,按y)
Please enter your Primary DNS server
It should be in the form ###.###.###.###
Where the "#" is either a number or blank space
Primary DNS server: [ ]:
(輸入數據局提供的DNS服務起IP,如:202.96.134.133)

If you have a Secondary DNS server please enter it
If none, just press enter
Secondary DNS server: []: (如果有輔助DNS,則在此輸入,如:202.96.128.68)

collected information
nameServer1 Name : 202.96.134.133
second nameserver: 202.96.128.68
is this correct?(answer y/n only) [y]:(再次確認信息是否正確,正確則按y)

would you like to start pppoed?(answer y/n only) [y]:(提示是否啟動pppoed)
到此pppoed安裝完成,在結束時,如果提示:
Starting pppoed: Warning: modutils is reading from /etc/modules.conf and
ignoring /etc/conf.modules. The use of /etc/conf.modules is
depreciated,
please remove /etc/conf.modules as soon as possible. Command
rm /etc/conf.modules
則請刪除/etc/conf.modules.模塊配置文件改用modules.conf。
三、配置相關文件
pppoe安裝后,在modules.conf中加入:
alias char-major-144 pppox
並將配置信息寫入/etc/sysconfig/network-scripts/ifcfg-ppp0中
更改ifcfg-ppp0中的這一句:
MODEMPORT="/dev/ppp0"
為:MODEMPORT="/dev/pppox0"
在安裝完pppoed后,/etc/ppp/目錄下的兩個文件應該如下:
-------------------------------------options-------------------------------------
lock
local
nocrtscts
noauth
#be careful with mtu/mru if you are masquerading.
# look at Kal Lin's page at http://www.cs.toronto.edu/~kal/hse/resource.html
mru 1490
mtu 1490
#please make sure you have noaccomp for now
noaccomp
#the construct below is needed by sympatico
name "szourweb@163.gd"
#you might want to change defaultroute if you have more
#than one pppoe session
defaultroute
hide-password
sync
#it might be a good idea to uncoment the debug below
#debug
#kdebug 7
#if you use the -R option to make it persistent
#then uncomment the next two lines below
#lcp-echo-interval 240
#lcp-echo-failure 3
#nodetach
----------------------------------end
options---------------------------------

-------------------------------------
pap-secrets------------------------------
# Secrets for authentication using PAP
# client server secret IP addresses
abc@163.gd * 123456
---------------------------------end
secrets----------------------------------
根據自己的實際情況更改相關項目。
至此,軟體設置完成。
將ANT和NTC連接無誤后運行:
# /etc/sbin/pppoed
就可以連接上了。
你可以:
# tail -f /var/log/message
看整個連接過程。
如果連接上了將出現以下類似信息:
Oct 25 01:59:59 adsl pppoed[10323]: starting /usr/sbin/pppd to interface
/dev/pp
pox0
Oct 25 01:59:59 adsl modprobe: Note: /etc/modules.conf is more recent than
/lib/
modules/2.2.15-4mdk/modules.dep
Oct 25 01:59:59 adsl kernel: registered device ppp0
Oct 25 01:59:59 adsl pppoed[10322]: Line id which died is: 0
Oct 25 01:59:59 adsl pppoed[10322]: OK we got killed
Oct 25 01:59:59 adsl pppoed[10322]: ppp_connect came back!
Oct 25 01:59:59 adsl pppd[10325]: pppd 2.3.11 started by root, uid 0
Oct 25 01:59:59 adsl pppd[10325]: Using interface ppp0
Oct 25 01:59:59 adsl pppd[10325]: Connect: ppp0 <--> /dev/pppox0
Oct 25 02:00:04 adsl kernel: PPP BSD Compression module registered
Oct 25 02:00:04 adsl kernel: PPP Deflate Compression module registered
Oct 25 02:00:04 adsl insmod: Note: /etc/modules.conf is more recent than
/lib/mo
dules/2.2.15-4mdk/modules.dep
Oct 25 02:00:05 adsl pppd[10325]: local IP address 61.141.206.79
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Oct 25 02:00:05 adsl pppd[10325]: remote IP address 61.141.204.1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

[root@adsl sysconfig]# netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt
Iface
192.168.0.8 0.0.0.0 255.255.255.255 UH 0 0 0
eth1
192.168.1.8 0.0.0.0 255.255.255.255 UH 0 0 0
eth0
61.141.204.1 0.0.0.0 255.255.255.255 UH 0 0 0
ppp0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0
eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0
eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 61.141.204.1 0.0.0.0 UG 0 0 0
ppp0

# ifconfig
ppp0 Link encap:Point-to-Point Protocol
inet addr:61.141.206.79 P-t-P:61.141.204.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1490 Metric:1
RX packets:13 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10

注意:在/usr/doc/pptp-adsl-fr-1.0.2目錄中有Alcatel的ADSL.htm,如果按照該文件的做法,運行pptp
alcatel ,會出錯:
# tail ?f /var/log/message
Oct 25 01:04:07 adsl pptp[10036]: connect: No route to host
Oct 25 01:04:07 adsl pptp[10036]: Could not open control connection to
192.168.0.138
Oct 25 01:04:07 adsl pptp[10035]: Call manager exited with error 256


[火星人 ] 在LINUX (Mandrake 7.0)下安裝ADSL已經有636次圍觀

http://coctec.com/docs/service/show-post-73860.html