Block IP addresses: Difference between revisions
From WickyWiki
Created page with "* https://help.ubuntu.com/community/IptablesHowTo Category:Ubuntu Category:Ubuntu Network Category:Ubuntu Server Category:201301" |
m 15 revisions |
||
| (14 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
== Install == | |||
Install Firestarter GUI for iptables: | |||
* https://help.ubuntu.com/community/IptablesHowTo | * https://help.ubuntu.com/community/IptablesHowTo | ||
See also: [[Configure iptables Firewall]] | |||
== Fix syslog error at startup == | |||
* https://bugs.launchpad.net/ubuntu/+source/firestarter/+bug/776361 | |||
<syntaxhighlight lang=bash> | |||
sudo gedit /etc/rsyslog.d/99-fixlog.conf | |||
</syntaxhighlight> | |||
<blockquote> | |||
<pre> | |||
*.=info;*.=notice;*.=warn;\ | |||
auth,authpriv.none;\ | |||
cron,daemon.none;\ | |||
mail,news.none -/var/log/messages | |||
</pre> | |||
</blockquote> | |||
<syntaxhighlight lang=bash> | |||
sudo service rsyslog restart | |||
</syntaxhighlight> | |||
== Enable block rule == | |||
To block 123.11.112.1 with iptables: | |||
<syntaxhighlight lang=bash> | |||
iptables -I INPUT -s 123.11.112.1 -j DROP | |||
</syntaxhighlight> | |||
To enable this functionality in firestarter edit this file: | |||
<syntaxhighlight lang=bash> | |||
sudo gedit /etc/firestarter/user-post | |||
</syntaxhighlight> | |||
Add the following line to the /etc/firestarter/user-post file: | |||
<blockquote> | |||
<pre> | |||
$IPT -I INPUT -s 123.11.112.1 -j DROP | |||
</pre> | |||
</blockquote> | |||
Restart service: | |||
<syntaxhighlight lang=bash> | |||
sudo service firestarter restart | |||
</syntaxhighlight> | |||
[[Category:Ubuntu]] | [[Category:Ubuntu]] | ||
Latest revision as of 07:26, 5 July 2013
Install
Install Firestarter GUI for iptables:
See also: Configure iptables Firewall
Fix syslog error at startup
sudo gedit /etc/rsyslog.d/99-fixlog.conf
*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none -/var/log/messages
sudo service rsyslog restart
Enable block rule
To block 123.11.112.1 with iptables:
iptables -I INPUT -s 123.11.112.1 -j DROP
To enable this functionality in firestarter edit this file:
sudo gedit /etc/firestarter/user-post
Add the following line to the /etc/firestarter/user-post file:
$IPT -I INPUT -s 123.11.112.1 -j DROP
Restart service:
sudo service firestarter restart