linux下adsl撥號

安裝撥號軟件
首先,你必須安裝相應的ADSL撥號軟件。平常用的redhat發行版本中,帶有pppoe這個rpm包。
我們通過下面的命令實現:
[root@www root]# rpm -qa|grep pppoe
rp-pppoe-3.4-7
這個命令的輸出來確定系統中是否已經安裝了pppoe這個包。rpm -qa是列出系統中已經安裝的包。通過管道|將這個命令的輸出,作爲第二個命令的輸入。grep pppoe是列出包含有pppoe的行。如果返回爲空,則說明沒有安裝。如果安裝了,會返回安裝了pppoe的版本號。如果你還沒有安裝的話,通過下面的命令安裝。
[root@www root]# rpm -ivh redhat/ppp-2.4.1-7.i386.rpm
這樣,你就安裝好了撥號需要的軟件。

配置網卡
撥號需要將撥號的網卡設置爲動態獲取ip。而動態獲取ip在機器啓動的時候,將會花費很長時間去獲取ip。所以,我們最好將網卡設置不啓動時不激活。
設置網卡,使用命令netconfig可以方面的配置網絡相關信息。當然,也可以通過修改網卡的配置文件實現:
[root@www root]# vim /etc/sysconfig/network-scripts/ifcfg-eth0

配置撥號軟件
安裝了撥號軟件,接下來,就進行設置,告訴pppoe怎麼撥號。啓動設置,通過下面這個命令:
[root@www root]# adsl-setup
首先,你會看到歡迎信息。
Welcome to the ADSL client setup. First, I will run some checks on
your system to make sure the PPPoE client is installed properly...
然後要求我們輸入登陸名。
LOGIN NAME
Enter your Login Name (default root):
接着,要求我們選擇使用的網絡接口。我們這時候,填入我們剛剛設置的那個網卡。對於大多數只有一個網卡的朋友而言,默認eth0就可以了。
INTERFACE

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 ethX, where 'X' is a number.
(default eth0):

接下來,詢問的是,adsl連接以後,是否持續保持連接。或者是自動的斷開,在指定的時間(以秒數計算)內。多數情況下,我們希望手動的打開關閉連接。所以這裏選擇默認的no。
Do you want the link to come up on demand, or stay up continuously?
If you want it to come up on demand, enter the idle time in seconds
after which the link should be dropped. If you want the link to
stay up permanently, enter 'no' (two letters, lower-case.)
NOTE: Demand-activated links do not interact well with dynamic IP
addresses. You may have some problems with demand-activated links.
Enter the demand value (default no):
再下來,就是dns了。我發現很多時候,pppoe都不能夠正確獲取dns信息。我建議你輸入dns地址。這些信息在isp的網站上一般都有公佈。
DNS

Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide dynamic DNS addresses',
enter 'server' (all lower-case) here.
If you just press enter, I will assume you know what you are
doing and not modify your DNS setup.
帳號密碼是必須,輸入兩次。密碼顯示風格和其他的地方一樣,不顯示在屏幕上。這個,我不知道改怎麼填寫。太高深的問題了。希望你將你的答案和我分享。:P。
PASSWORD

Please enter your Password:
Please re-enter your Password:
下面的設置,是表示是否允許普通用戶啓用/關閉 ADSL連接。默認是允許。
Please enter 'yes' (two letters, lower-case.) if you want to allow
normal user to start or stop DSL connection (default yes):
我們看下防火牆選項。這裏提供的防火牆可以給你提供基本的安全保護。我不推薦你使用——你最好選擇“NONE”選項。無論是什麼樣的用戶使用,我都建議你使用額外的工具來配置防火牆規則(iptables目前看來是一個非常不錯的工具)。
FIREWALLING

Please choose the firewall rules to use. Note that these rules are
very basic. You are strongly encouraged to use a more sophisticated
firewall setup; however, these will provide basic security. If you
are running any servers on your machine, you must choose 'NONE' and
set up firewalling yourself. Otherwise, the firewall rules will deny
access to all standard servers like Web, e-mail, ftp, etc. If you
are using SSH, the rules will block outgoing SSH connections which
allocate a privileged source port.

The firewall choices are:
0 - NONE: This script will not set any firewall rules. You are responsible
for ensuring the security of your machine. You are STRONGLY
recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
for a LAN
Choose a type of firewall (0-2): Start this connection at boot time
是否在開機時,打開這個連接?
Do you want to start this connection at boot time?**
所有的配置信息填寫完成之後,系統將給出一個報告,完整的顯示出你輸入的配置信息。如果,你確信你輸入的配置信息是正確的,輸入yes寫入配置文件。輸入no放棄配置。
Summary of what you entered **

Ethernet Interface: eth0
User name: root
Activate-on-demand: No
DNS: Do not adjust
Firewalling: NONE
User Control: yes
Accept these settings and adjust configuration files (y/n)?

Please enter no or yes (default no):



Congratulations, it should be all set up!

Type '/sbin/ifup ppp0' to bring up your xDSL link and '/sbin/ifdown ppp0'
to bring it down.
Type '/sbin/ADSL-status /etc/sysconfig/network-scripts/ifcfg-ppp0'
to see the link status.

測試撥號
現在,我們需要測試下我們的撥號是否配置正確了。
輸入ADSL-start撥號。一般情況下,我會ping 我的ISP的主WWW服務器。比如
ping www.scmy169.com
如果不怕麻煩,打開瀏覽器測試下,也可以。如果一切ok。那麼我們就可以結束我們的配置了。
當然,你關閉連接的話,使用命令adsl-stop就可以了。
發佈了36 篇原創文章 · 獲贊 0 · 訪問量 9萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章