Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

CentOS 6 設定 ADSL 撥號上網完整教學

編輯:Linux 教學

CentOS 6 版本起,ADSL 撥號工具從傳統的 adsl-setup 改為 rp-pppoe 套件。本文記錄從安裝套件、掛載光碟到完成撥號配置的完整流程,適合需要在無網路環境下透過安裝光碟離線部署的場景。

前置準備:安裝 rp-pppoe 套件

  1. 將 CentOS 6 安裝光碟放入光碟機
  2. 掛載光碟:
    # mount /dev/cdrom /media
  3. 尋找套件路徑:
    # find /media -name 'rp-pppoe*'
  4. 直接安裝(無相依性問題):
    # rpm -ivh /media/CentOS_6.0_Final/Packages/rp-pppoe-3.10-8.el6.i686.rpm

執行 pppoe-setup 互動式配置

安裝完成後執行 # pppoe-setup 進入配置精靈,以下為關鍵步驟說明:

1. 裝置選擇

Please enter the device if you want to configure the present DSL config
(default ppp0) or enter 'n' if you want to create a new one: ppp0

直接按 Enter 採用預設 ppp0。

2. 登入帳號

Enter your Login Name (default root): 輸入 ISP 提供的 ADSL 帳號(中華電信通常以 ad 開頭)

3. 網路介面

Enter the Ethernet interface connected to the PPPoE modem
(default eth0): eth0

單網卡環境通常為 eth0,多網卡請依實際情況選擇。

4. 連線模式

Do you want the link to come up on demand, or stay up continuously?
Enter the demand value (default no): 直接按 Enter(選 no)

選 no 代表持續保持連線,適合伺服器或長期在線需求。

5. DNS 設定(建議手動指定)

Enter the DNS information here: 202.96.209.5   # 主 DNS(以電信為例)
Enter the secondary DNS server address here: 202.96.209.133  # 備 DNS

注意:若選擇 server 由 ISP 動態分配,某些情況下會導致解析失敗,建議手動填入穩定的 DNS。

6. 密碼設定

Please enter your Password: 輸入 ADSL 密碼
Please re-enter your Password: 再次確認密碼

7. 使用者控制權限

Please enter 'yes' if you want to allow normal user to start or stop DSL connection (default yes): no

建議輸入 no,僅允許 root 控制撥號,提升安全性。

8. 防火牆選項

Choose a type of firewall (0-2): 0
  • 0 NONE:不設定防火牆規則(若跑服務請選此項,自行配置 iptables)
  • 1 STANDALONE:適合單機上網
  • 2 MASQUERADE:適合作為區域網路閘道

9. 開機自動撥號

Do you want to start this connection at boot time? (default no): yes

10. 確認寫入配置

Accept these settings and adjust configuration files (y/n)? y

啟動與驗證連線

# pppoe-start    # 啟動 ADSL 連線
# pppoe-status   # 查看連線狀態

若顯示 Connected! 並顯示 IP 位址,即代表撥號成功。

常見問題排查

  • 無法解析網域:檢查 /etc/resolv.conf 是否正確寫入 DNS
  • 撥號失敗:確認帳號密碼正確、網卡介面名稱正確(可用 ip link 查看)
  • 防火牆阻擋:若選擇防火牆選項 1 或 2,可能阻擋入站服務,建議選 0 並自行管理 iptables

完成上述步驟,CentOS 6 即可穩定透過 ADSL 上網。若為虛擬機環境,建議改用 NAT 或橋接模式直接共享宿主機網路,較為簡便。

Copyright © Windows教程網 All Rights Reserved