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

FreeBSD 建立 ADSL 撥號閘道伺服器:PPPoE 設定、mpd 安裝、NAT 啟用完整教學

編輯:Windows 技巧

概念釐清

  • PPPoE:ADSL 撥號,Modem 視為撥號器,如本機裝置般使用。
  • PPTP:企業/校園網撥號伺服器,具固定 IP,用於計費/安全控管。

本文針對 PPPoE/ADSL 情境。

安裝 mpd(PPP 守護程式)

# Ports 編譯
cd /usr/ports/net/mpd
make install clean

# 或 pkg 安裝
pkg_add mpd-3.13.tbz

/etc/ppp/ppp.conf 關鍵設定


default:
 set log Phase Chat LCP IPCP CCP tun command
 nat enable yes
 nat same_ports yes
 nat use_sockets yes
 set redial 15 28800
 set reconnect 15 28800

pppoe:
 set device PPPoE:fxp0:
 set mru 1492
 set mtu 1492
 set speed sync
 enable lqr
 set lqrperiod 5
 set cd 5
 set dial
 set login
 set timeout 0
 set authname Your_UserName
 set authkey Your_Password
 set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
 add default HISADDR
 enable dns

關鍵修改點

  1. fxp0 → 實際 PPPoE 撥出網卡介面名(用 ifconfig -a 確認)。
  2. authname / authkey → ISP 提供帳號密碼。

啟用 NAT 讓內網上網

nat enable yes 等三行已在 default 區段啟用 NAT,內網機器指向此閘道即可共享上網。

設定完成後以 ppp -auto pppoe 背景撥號,或寫入 /etc/rc.conf 開機自動連線。

Copyright © Windows教程網 All Rights Reserved