Re: 如何阻擋搜尋網站用 robot 抓取網頁~
拜讀 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
===
"<此位網友正巧摸魚>" <uftea.bbs@bbs.ntou.edu.tw> 撰寫於郵件新聞:4G9glj$tGc@bbs.ntou.edu.tw...
>※ 引述《goaway@nowhere.not (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
討論串 (同標題文章)
完整討論串 (本文為第 9 之 10 篇):
FreeBSD 近期熱門文章
PTT數位生活區 即時熱門文章