[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: firewall domestico



ho usato lo script per iptables del security quick start howto:

http://www.tldp.org/HOWTO/Security-Quickstart-HOWTO/firewalls.html#FILTERS

--------------------------------------------------------------------------
#!/bin/sh
#
# iptables.sh
#
# An example of a simple iptables configuration. 
#
# This script allows ALL outbound traffic, and denies 
# ALL inbound connection attempts.
#
###################################################################
# Begin variable declarations and user configuration options ######
#

# Local Interfaces
# This is the WAN interface that is our link to the outside world.
# For pppd and pppoe users.
# WAN_IFACE="ppp0"
WAN_IFACE="eth0"
#

## end user configuration options #################################
###################################################################

# Any and all addresses from anywhere.
ANYWHERE="0/0"

# This module may need to be loaded:
modprobe ip_conntrack_ftp

# Start building chains and rules #################################
#
# Let's start clean and flush all chains to an empty state.
iptables -F  

# Set the default policies of the built-in chains. If no match for any 
# of the rules below, these will be the defaults that IPTABLES uses.
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -P INPUT DROP

# Accept localhost/loopback traffic.
iptables -A INPUT -i lo -j ACCEPT

## ICMP (ping)
#
# ICMP rules, allow the bare essential types of ICMP only. Ping
# request is blocked, ie we won't respond to someone else's pings,
# but can still ping out.
iptables -A INPUT  -p icmp  --icmp-type echo-reply \
   -s $ANYWHERE -i $WAN_IFACE -j ACCEPT
iptables -A INPUT  -p icmp  --icmp-type destination-unreachable \
   -s $ANYWHERE -i $WAN_IFACE -j ACCEPT
iptables -A INPUT  -p icmp  --icmp-type time-exceeded \
   -s $ANYWHERE -i $WAN_IFACE -j ACCEPT

###################################################################
# Set the catchall, default rule to DENY, and log it all. All other
# traffic not allowed by the rules above, winds up here, where it is
# blocked and logged. This is the default policy for this chain
# anyway, so we are just adding the logging ability here with '-j
# LOG'. Outgoing traffic is allowed as the default policy for the
# 'output' chain. There are no restrictions on that.

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m state --state NEW -i ! $WAN_IFACE -j ACCEPT
iptables -A INPUT -j LOG -m limit --limit 30/minute --log-prefix
"Dropping: "

echo "Iptables firewall is up `date`."

##-- eof iptables.sh

-----------------------------------------------------------------

sembra andato tutto bene ma quando guardo la lista delle rules mi
restituisce:

-----------------------------------------------------------------

cervellone:~# iptables -L                            
Chain INPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere           
ACCEPT     icmp --  anywhere             anywhere           icmp
echo-reply 
ACCEPT     icmp --  anywhere             anywhere           icmp
destination-unreachable 
ACCEPT     icmp --  anywhere             anywhere           icmp
time-exceeded 
ACCEPT     all  --  anywhere             anywhere           state
RELATED,ESTABLISHED 
ACCEPT     all  --  anywhere             anywhere           state NEW 
LOG        all  --  anywhere             anywhere           limit: avg
30/min burst 5 LOG level warning prefix `Dropping: ' 

Chain FORWARD (policy DROP)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination  
 
-----------------------------------------------------------------------

quello che non mi piace è la prima riga della catena INPUT. si riferisce
al loopback o c'è qualche errore?


ciao,
Leonardo


--
To UNSUBSCRIBE, email to debian-italian-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: