2007年7月13日 星期五

Add an ip or a range to the whitelist of MoBlock on CentOS

1. if there's an IP address you need to whitelist, find the entry in /etc/moblock/guarding.p2p, for example:

FooBar, inc:192.0.34.164-192.0.34.168

2. you need to make a basic regular expression for grep from this line and put it in /etc/moblock/whitelist. To match the exact line, you need to put a backslash (\) before every metacharacter (\, ., ^, $, [) and put a caret ^ at the beginning and a dollar sign $ at the end. In this example, a valid expression is:

^FooBar, inc:192\.0\.34\.164-192\.0\.34\.168$

see the manpages for grep for more information.

沒有留言: