看板FreeBSD
标 题Re: 如何阻挡搜寻网站用 robot 抓取网页~
发信站Shaw Residential Internet (Sun Jan 9 13:47:09 2005)
转信站ptt!ctu-reader!ctu-peer!news.nctu!newshub.sdsu.edu!elnk-nf2-pas!elnk-p
拜读
http://freebsd.ntut.idv.tw/document/freebsd_pf_nat.html 及 该站诸篇大作,
让後学可以依样画葫卢, 感谢感谢
但後学鲁钝新手, 碰到困难 不知如何变通,
就是, 他举的例都是 两(或三)张网卡;
後学的环境是 :
ISP - cable modem - 有线/无线基地台兼 router -
intranet 192.168.1.0/24
{
freeBSD : 乃各 server
winXP : ( intranet 各 workstations)
winXP : ( intranet 各 workstations)
....
}
故, fBSD 只一张 网卡
故,不知如何修改这些 改项:
http://freebsd.ntut.idv.tw/document/freebsd_pf_nat.html
请问, 譬如是... 这样吗... ?
#vi /etc/rc.conf # 设定开机启动档
defaultrouter="192.168.1.254" ## 这行改这样可吗 ?
hostname="my.host.domain"
ifconfig_fxp0="inet 192.168.1..3 netmask 255.255.255.0" ## 这行改这样可吗 ?
inetd_enable="YES"
pf_enable="YES"
pflog_enable="YES"
#vi /etc/sysctl.conf # 开启 NAT 的 IP Forwarding 环境
net.inet.ip.forwarding=0 ## 这行改这样可吗 ?
#vi /etc/inetd.conf # 打开 ftp 的替代 port 如此 NAT 内部才能对外使用
ftp 抓东西
# ftp-proxy stream tcp nowait root /usr/libexec/ftp-proxy
ftp-proxy
## 上面这行是否就不必了,既然我只一张网卡; 而 intranet 各 workstation 对 fBSD
都是平行的.
# Macros 定义网路介面
ext_if="fxp0"
int_if="fxp0" ## 这行改这样可吗 ?
# ALTQ 定义频宽控制的进出
# Outgoing bandwidth limit
altq on $ext_if cbq bandwidth 512Kb queue { std_out }
queue std_out bandwidth 256Kb cbq (default)
# Incoming bandwidth limit
altq on $int_if cbq bandwidth 2Mb queue { std_in }
queue std_in bandwidth 768Kb cbq (default borrow)
# NAT 定义封包转换
nat on $ext_if from $int_if:network to any -> ($ext_if)
rdr on $int_if proto tcp from any to any port 21 -> 127.0.0.1 port 8021
# Filter Rules 定义防火墙规则
pass in all
pass out all
# Bandwidth Control
pass out on $ext_if proto tcp from any to any queue std_out
pass in on $int_if proto tcp from any to any queue std_in
请问, 譬如是... 以上这样吗... ?
新手鲁钝, 请不吝详加指导
谢谢 :)
<: Neuro :>
http://neuro.ohbi.net
http://neuro.no-ip.info
http://neuro.dyndns.tv
http://neuro.supt.net
http://neuro.taiwantop.com
===
"<此位网友正巧摸鱼>" <
[email protected]> 撰写於邮件新闻:
[email protected]...
>※ 引述《
[email protected] (neuro)》之铭言:
>> 如何 用 freeBSD 的 firewall (ipfw ? ) 封杀 这些 ip subnet 呢 ?
>
> 也许 PF 是个很不错的选择..
>
> http://freebsd.ntut.idv.tw/document/freebsd_pf_nat.html
>
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls-pf.html