
## 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.
$IPCHAINS −A input −p icmp −−icmp−type echo−reply \
−s $ANYWHERE −i $WAN_IFACE −j ACCEPT
$IPCHAINS −A input −p icmp −−icmp−type destination−unreachable \
−s $ANYWHERE −i $WAN_IFACE −j ACCEPT
$IPCHAINS −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 '−l'.
# Outgoing traffic is allowed as the default policy for the 'output'
# chain. There are no restrictions on that.
$IPCHAINS −A input −l −j DENY
echo "Ipchains firewall is up `date`."
##−− eof ipchains.sh
8.10.2. iptables II
#!/bin/sh
#
# iptables.sh
#
# An example of a simple iptables configuration. This script
# can enable 'masquerading' and will open user definable ports.
#
###################################################################
# Begin variable declarations and user configuration options ######
#
# Set the location of iptables (default).
IPTABLES=/sbin/iptables
# 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"
#
# Local Area Network (LAN) interface.
#LAN_IFACE="eth0"
LAN_IFACE="eth1"
# Our private LAN address(es), for masquerading.
LAN_NET="192.168.1.0/24"
# For static IP, set it here!
#WAN_IP="1.2.3.4"
Security Quick−Start HOWTO for Red Hat Linux
8.10.2. iptables II 74
Commenti su questo manuale