西宁水井巷美食:利用FreeBSD建立ADSL拨号网关服务器

来源:百度文库 编辑:九乡新闻网 时间:2024/03/29 22:43:37
利用FreeBSD建立ADSL拨号网关服务器

HD

说明
为了让大家明白PPPoE与PPTP的不同,以免产生我之前的混淆,先告诉大家它们的用处。现在我们使用PPPoE主要是ADSL,我们可以视ADSL Modem只是一个拨号器,它不带网络功能,就像使用本机设备一样的去使用它。而PPTP则是在网络上具有一个IP地址的服务器,我所知通常在校园网、公司网中会大量使用这样的拨号服务器以进行记费或是安全保障。

安装必须的软件
由于ppp是FreeBSD自带的一个功能,mpd则是一个FreeBSD的附加软件。你可以使用FreeBSD的Ports Collection来编译它。mpd最新的版本为3.13,使用ports的编译方法为:
%cd /usr/ports/net/mpd
%make install
%make clean
如果你没有安装Ports Collection,哪么也可以到http://www.huangdong.com/bbs/中的BSD版的精华区中找到mpd3.13的package安装包。使用package安装包的安装方法为:
%pkg_add mpd-3.13.tbz

ppp的拨号设置
ppp的拨号设置主要是设置都会是在/etc/ppp/ppp.conf中。以下是一个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 used to login
set authkey Your Password used to login
set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
add default HISADDR# Add a (sticky) default route
enable dns
你需要将“set device PPPoE:fxp0:”中的fxp0变更为你的PPPoE拨出的网卡接口设备名。还有就是更改“set authname Your UserName used to login ”和“set authkey Your Password used to login”中的Your xxx成为你的用户名和密码。如果不知道自己的网卡设备名,哪么可以通过ifconfig命令来得到,我的计算机的结果如下:
%ifconfig -a
fxp0: flags=8843 mtu 1500
inet 192.168.10.50 netmask 0xffffff00 broadcast 192.168.10.255
ether 00:d0:59:0d:08:03
media: Ethernet autoselect (10baseT/UTP)
status: active
lo0: flags=8049 mtu 16384
inet 127.0.0.1 netmask 0xff000000

 

 from site :  http://www.cnfug.org/journal/systems/2004/000003.html