Shorewall is another firewall interface that operate on CLI. This is taken from the Shorewall's introduction :
"The Shoreline Firewall, more commonly known as “Shorewall”, is high-level tool for configuring Netfilter. You describe your firewall/gateway requirements using entries in a set of configuration files. Shorewall reads those configuration files and with the help of the iptables, iptables-restore, ip and tc utilities, Shorewall configures Netfilter and the Linux networking subsystem to match your requirements. Shorewall can be used on a dedicated firewall system, a multi-function gateway/router/server or on a standalone GNU/Linux system. Shorewall does not use Netfilter's ipchains compatibility mode and can thus take advantage of Netfilter's connection state tracking capabilities."
Shorewall's way of configuring iptables firewall made easy by just describing the rules and interfaces into a few files and the firewall is ready to go. Shorewall's website also provides extensive documentation on how it works and how to setup.
This post's intended to setup Shorewall in a few simple steps and thus, it is not really suitable to implement it on medium to large enterprise. Here it is :
1. Install shorewall using apt :
apt-get install shorewall shorewall-common shorewall-shell
2. Copy some samples that comes with shorewall :
cp /usr/share/doc/shorewall-common/default-config/interfaces /etc/shorewall/ cp /usr/share/doc/shorewall-common/default-config/policy /etc/shorewall/ cp /usr/share/doc/shorewall-common/default-config/rules /etc/shorewall/ cp /usr/share/doc/shorewall-common/default-config/zones /etc/shorewall/
3. Set the below parameter to :
STARTUP_ENABLED=Yesin
/etc/shorewall/shorewall.conf(if it does not exist, extract it from /usr/share/doc/shorewall-common/examples/one-interface/shorewall.conf.gz)
4. Configure the firewall's interface. Insert :
net eth0 detect dhcpinto
/etc/shorewall/interfaces
5. Configure the firewall's default policy. Insert :
$FW net ACCEPT net all DROP info all all DROP infointo
/etc/shorewall/policy
6. Configure the firewall's rules. Insert :
ACCEPT net $FW tcp 8899
7. Configure the firewall's zones. Insert :
fw firewall net ipv4 loc ipv4
8. Finally, start Shorewall's service,
/etc/init.d/shorewall start
Some log files to check out, just in case something fails :
- /var/log/shorewall-init.log for shorewall startup messages
- /var/log/messages for rules related problems
Ate mais !!!
No comments:
Post a Comment