一、安裝rp-pppoe
到
http://www.roaringpenguin.com/pppoe/#download下載最新版rp-pppoe 的原始碼。
tar xzvf rp-pppoe-3.5.tar.gz
然後進入解壓產生的目錄:
cd rp-pppoe-3.5
cd src
接下來就是常規的配置編譯和安裝,一切按預設的即可:
./configure
make
make install
至此,安裝結束,下面是設定過程。
二、設定
1. 配置你的網卡,運行:ifconfig eth0
不要給這個網卡(串連ADSL modem的網卡)設定IP地址,另外也不要設定成啟動系統時啟用網卡。
2. 運行adsl-setup#adsl-setup
Welcome to the Roaring Penguin ADSL client setup. First, I will run some checks on your system to make sure the PPPoE client is installed properly... Looks good! Now, please enter some information:
USER NAME
>;>;>; Enter your PPPoE user name (default XXX): 在這裡輸入ADSL的使用者名稱
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 ethn, where 'n' is a number. (default eth0):如果一張網卡就設定寫上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 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
Please enter the IP address of your ISP's primary DNS server. If your ISP claims that 'the server will provide 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.
>;>;>; Enter the DNS information here:在這裡寫上主用DNS地址:202.106.0.20
下一個備用DNS地址是202.106.196.115 //這裡是北京CNC的DNS伺服器位址,你可以根據你所在的地區設定不同的DNS伺服器位址。
PASSWORD
>;>;>; Please enter your PPPoE password:輸入密碼
>;>;>; Please re-enter your PPPoE password:再輸入一次
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):這裡添寫為2
** Summary of what you entered **
Ethernet Interface: eth0
User name: XXX
Activate-on-demand: No
DNS: Do not adjust
Firewalling: MASQUERADE
>;>;>; Accept these settings and adjust configuration files (y/n)?
3. 查看/etc/ppp/pap-secrets,裡面應該有你剛才設定的帳號和密碼(密碼是*)。
4. 編輯/etc/ppp/pppoe.conf
ETH=eth1 將eth1改為eth0(如果你只有一個網卡的話) USER=bxxxnxnx@sympatico.ca 將bxxxnxnx@sympatico.ca改為你剛才設定的ADSL帳號 別的不要動。
5. 查看/etc/resolv.conf
nameserver xxx.xxx.xxx.xxx (應該是你設定的第一DNS地址)
nameserver xxx.xxx.xxx.xxx (應該是你設定的第二DNS地址)
6. 運行adsl-connect &串連,期間可以查看你的連結狀態:adsl-status