2014-06-21 32 views
4

我使用的fail2ban v.0.8.2,但我不能解除禁止的IP:的fail2ban:IP(使用的fail2ban客戶端)如何黑名單中刪除

用的fail2ban客戶端我看到IP:

fail2ban-client status fail2ban 

Status for the jail: fail2ban 
|- filter 
| |- File list: /var/log/fail2ban.log 
| |- Currently failed: 1 
| `- Total failed: 8 
`- action 
    |- Currently banned: 2 
    | `- IP list: 151.10.65.197 151.10.72.169 
    `- Total banned: 2 

從手冊頁應該有足夠這樣做:

fail2ban-client get fail2ban actionunban 151.10.65.197 

命令的輸出不會返回錯誤,但:

iptables -L -nv |grep -b2 -a1 151 

16262- pkts bytes target  prot opt in  out  source    destination   
16351: 0  0 DROP  all -- *  *  151.10.72.169  0.0.0.0/0   
16440: 0  0 DROP  all -- *  *  151.10.65.197  0.0.0.0/0   
16529- 181K 48M RETURN  all -- *  *  0.0.0.0/0   0.0.0.0/0 

fail2ban-client status fail2ban 

輸出是相同的上述的,因此命令不會運行。

回答

4

你需要使用fail2ban-client get jail-name actionunban ipaddress這將允許你取消一個IP地址。使用iptables -L -n查找正確的jail-name的使用狀態?給出的命令:fail2ban-client get fail2ban actionunban xxx.xxx.xxx.xxx根據輸出結果是正確的。再次檢查狀態以確保它尚未被超時解除封鎖。這將解釋爲什麼命令失敗。

這是一個很好的頁面Fail2ban Manual Unban Single Host (for iptables)取決於版本,已經對unban過程語法(get/set)進行了更改。

+0

大衛:你的命令在回覆這是我的問題,並沒有運行。感謝幫助。 –

+0

這裏有一個解釋問題的howto:http://blog.shanghai-hosting.com/2013/10/tech-how-to-unban-an-ip-address-from-your-server-using-fail2ban/但我的版本中的「unbanip」未實現(並且我無法升級它) –

+0

@PolHallen是否使用了具體的與actionunban命令?更新了答案。 –

相關問題