標籤:
下面主要介紹一下,在CentOS命令列環境下如何配置 ADSL 連網:
1、確保安裝了網卡並能正常運行,使用命令查看一下網卡狀態:[[email protected] simon]# /sbin/ifconfig eth02、在系統中不要設定預設路由(網關),讓 ADSL 撥號後自動獲得。3、查看是否安裝了 pppoe 軟體包。[[email protected] simon]# rpm -qa|grep ppp0e沒有顯示,說明沒有安裝,系統光碟片裡會有這個安裝包,或去下載一個 rpm 包,安裝一下就OK了。如所示進行安裝:4、安裝好軟體包後,就可開始配置 ppp0e 用戶端軟體了,我們不必手工去改動設定檔,可以使用 adsl-setup 這個工具進行配置:[[email protected] simon]# adsl-setupWelcome to the ADSL client setup. First, I will run some checks onyour system to make sure the PPPoE client is installed properly...LOGIN NAMEEnter your Login Name (default root): ***** //(輸入 ADSL 帳號的使用者名稱,這裡是你去辦理寬頻時申請的使用者名稱)INTERFACEEnter the Ethernet interface connected to the ADSL modemFor Solaris, this is likely to be something like /dev/hme0.For Linux, it will be ethX, where ‘X‘ is a number.(default eth0): //(選擇網路裝置,敲斷行符號,系統就會預設選擇)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 secondsafter which the link should be dropped. If you want the link tostay up permanently, enter ‘no‘ (two letters, lower-case.)NOTE: Demand-activated links do not interact well with dynamic IPaddresses. You may have some problems with demand-activated links.Enter the demand value (default no): no //(問你是否按需撥號,還是持續串連網路,我選擇 no)DNSPlease 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 aredoing and not modify your DNS setup.Enter the DNS information here: server //(選擇 DNS ,這表示使用 ADSL 撥號會自動獲得的 DNS 伺服器IP 位址,自動擷取就輸入 server 吧)PASSWORDPlease enter your Password: // (輸入申請 ADSL 帳號時設定的密碼)Please re-enter your Password: Sorry, the passwords do not match. Try again? (y/n)y // (我密碼輸入不匹配,就提示重新輸入)PASSWORDPlease enter your Password: // (輸入申請 ADSL 帳號時設定的密碼,一定要輸入正確喲)Please re-enter your Password: USERCTRLPlease enter ‘yes‘ (three letters, lower-case.) if you want to allownormal user to start or stop DSL connection (default yes): no //(是否允許普通使用者啟動、關閉)FIREWALLINGPlease choose the firewall rules to use. Note that these rules arevery basic. You are strongly encouraged to use a more sophisticatedfirewall setup; however, these will provide basic security. If youare running any servers on your machine, you must choose ‘NONE‘ andset up firewalling yourself. Otherwise, the firewall rules will denyaccess to all standard servers like Web, e-mail, ftp, etc. If youare using SSH, the rules will block outgoing SSH connections whichallocate a privileged source port.The firewall choices are:0 - NONE: This script will not set any firewall rules. You are responsiblefor ensuring the security of your machine. You are STRONGLYrecommended to use some kind of firewall rules.1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation2 - MASQUERADE: Appropriate for a machine acting as an Internet gatewayfor a LANChoose a type of firewall (0-2): 0 //(選擇 firewall 的規則,我選擇 0 ,不使用防火牆 )Start this connection at boot timeDo you want to start this connection at boot time?Please enter no or yes (default no):yes // (問你是否選擇隨機啟動)** Summary of what you entered **Ethernet Interface: eth0User name: adsladminActivate-on-demand: NoDNS addresses: Supplied by ISP‘s serverFirewalling: NONEUser Control: noAccept these settings and adjust configuration files (y/n)? y // (確認一下是否接受設定,如果輸入的資訊正確,當然選 y 了)Adjusting /etc/sysconfig/network-scripts/ifcfg-ppp0Adjusting /etc/ppp/chap-secrets and /etc/ppp/pap-secrets(But first backing it up to /etc/ppp/chap-secrets.bak)(But first backing it up to /etc/ppp/pap-secrets.bak)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.[[email protected] simon]# adsl-start // 這裡就不用解釋了吧大功告成,開始上網嘍
centos ADSL 撥接設定