#!/bin/bash
#

## Firewall Script
#  01-07-26  by Erik Wegner
#  icmp-up 
#

# Pfad zu IPTables
if test -z $IPTABLES ; then
	IPTABLES=/usr/sbin/iptables
fi

echo "ICMP ..."

echo "Ping -> World"
$IPTABLES -A OUTPUT -p ICMP --icmp-type echo-request -j ACCEPT
$IPTABLES -A INPUT -p ICMP --icmp-type echo-reply -j ACCEPT

for if in $1 ; do {
	echo "Ping <- $if"
	$IPTABLES -A INPUT -i $if \
		-p ICMP --icmp-type echo-request -j ACCEPT
	$IPTABLES -A OUTPUT -o $if \
		-p ICMP --icmp-type echo-reply -j ACCEPT
} ; done
