hello!
I am using slitaz 4.0 on dell c600, now I would like to have a good firewall
I am using gufw (graphic firewall configuration) with ubuntu 12.04.1 on another laptop. I configured gufw this way: incoming=deny, outgoing=allow, and I didn't add any rule (I read it is safe to deny all incoming and allow all outgoing). This way I never had any problem, I mean I successfully can navigate, watch videos, download... (to use transmission I just have to open the right port when necessary) no matter if I use a wired or wireless connection
So I have been searching for a similar graphical firewall for slitaz, before installing and configuring the firewall:
According to this post http://forum.slitaz.org/topic/firewall:
===============================
Open terminal login root password root
hwsetup firewall
hwsetup script should install iptables change IPTABLES=no to IPTABLES=yes in /etc/firewall.conf
and start firewall with /etc/init.d/firewall start
================================
According to http://doc.slitaz.org/en:handbook:networkconf, this is a good example of using iptables
================================
# Netfilter/iptables rules.
# This shell function is included in /etc/init.d/firewall.sh
# to start iptables rules.
#
iptables_rules()
{
# Drop all connections.
iptables -P INPUT DROP
iptables -P OUTPUT DROP
# Accept all on localhost (127.0.0.1).
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
# Accept all on the local network (192.168.0.0/24).
iptables -A INPUT -s 192.168.0.0/24 -j ACCEPT
iptables -A OUTPUT -d 192.168.0.0/24 -j ACCEPT
# Accept port 80 for the HTTP server.
iptables -A INPUT -i $INTERFACE -p tcp --sport 80 -j ACCEPT
iptables -A OUTPUT -o $INTERFACE -p tcp --dport 80 -j ACCEPT
# Accept port 22 for SSH.
iptables -A INPUT -i $INTERFACE -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -o $INTERFACE -tcp --sport 22 -j ACCEPT
# Accept port 21 for active FTP connections.
iptables -A INPUT -i $INTERFACE -p tcp --dport 21 -j ACCEPT
iptables -A OUTPUT -i $INTERFACE -p tcp --sport 21 -j ACCEPT
}
===================================
- If I only want to deny all incoming and allow all outgoing the same safe way as gufw in ubuntu. Is it ok if I only write this iptables (without any other rule)?:
===============================
# Netfilter/iptables rules.
# This shell function is included in /etc/init.d/firewall.sh
# to start iptables rules.
#
iptables_rules()
{
# Drop all input connections.
iptables -P INPUT DROP
# Accept all output connections.
iptables -P OUTPUT ACCEPT
}
===============================
- Everytime I turn on the pc. Do I have to start the firewall with the command:
# /etc/init.d/firewall start
- Anyway, what is the right way to verify the status of the firewall (to check if it is enable or not)?
thanks for pay attention! bye