FreeeBSD ADSL 撥接設定

設定 PPPoE 不難,首先切換到 /etc/ppp 目錄下找到 ppp.conf 來進行幾行設定就可以了

########################################
# PPP Sample Configuration File
# Originally written by Toshiharu OHNO
# Simplified 5/14/1999 by wself@cdrom.com
#
# See /usr/share/examples/ppp/ for some examples
#
# $FreeBSD: src/etc/ppp/ppp.conf,v 1.8 2001/06/21 15:42:26 brian Exp $
########################################

default:
set log Phase Chat LCP IPCP CCP tun command
ident user-ppp VERSION (built COMPILATIONDATE)

# Ensure that "device" references the correct serial port
# for your modem. (cuaa0 = COM1, cuaa1 = COM2)
#
#set device /dev/cuaa1
set device PPPoE:lnc0 <- 這一行要設成網卡的型號,我的是 lnc0

set speed 115200
set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \
\"\" AT OK-AT-OK ATE1Q0 OK \\dATDT\\T TIMEOUT 40 CONNECT"
set timeout 180 # 3 minute idle timer (the default)
enable dns # request DNS info (for resolv.conf)

papchap: <- 這會用得到喔,要記一下
#
# edit the next three lines and replace the items in caps with
# the values which have been assigned by your ISP.
#

set phone PHONE_NUM
set authname xxxxx@hinet.net <- 您所拿到的帳號
set authkey xxxxx <- 密碼囉
set dial <- 設定撥接
set login <- 設定登錄
set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
delete ALL <- 會將先前的設定取消,再自動重新抓設定
add default HISADDR # Add a (sticky) default route

設定好 /etc/ppp/ppp.conf 後,接下來再到 /etc/rc.conf 做一些設定

ppp_enable="YES" <- 開機自動啟用 PPPoE 連線
ppp_mode="ddial" <- 連接方式為撥接
ppp_profile="papchap" <- 啟動 PPPoE 的撥接名稱,剛才說要記得的部份
ppp_user="root" <-使用者為 root

設定好了再重開機後就 OK 啦!若要停止連線的話,只要打下面這行指令就好了
# killall ppp
或是

kill `cat /var/run/tun0.pid`

留言