<zitat>
Nun ja, mittels Yast kann man die "Firewall" so einstellen, dass Dienste nach außen hin angeboten werden können.
..und ich hätte da gerne das Äquivalent zu Yast gewußt.
</zitat>
Für den Fall dass du eine "Firewall" für Debian einrichten willst, könntest du das folgende Skript benutzen (und/oder erweitern), nach /etc/init.d kopieren und links in /etc/rc<blub> anlegen, sodass es automatisch beim Rechnerstart gestartet wird. Es ist allerdings langsam und schließt genau die Ports für ppp0, für die Dienste laufen.
#!/bin/bash
function firewall_ein ()
{
echo -n "Starting Firewall ."
[ -f /sbin/iptables ] || (echo "ALERT! iptables nicht installiert; Firewallskript bricht ab!"; exit 1)
[ -f /usr/bin/nmap ] || (echo "ALERT! nmap nicht installiert; Firewallskript bricht ab!"; exit 1)
nmap -sT localhost | grep open | cut -d / -f 1 | while read Portnummer
do
iptables -A INPUT -i ppp0 -p tcp --destination-port "$Portnummer" -j REJECT
[ $? -eq 0 ] || echo "ALERT! Firewall: TCP Ports nicht geschlossen!" && echo -n " ."
done
nmap -sU localhost | grep open | cut -d / -f 1 | while read Portnummer
do
iptables -A INPUT -i ppp0 -p udp --destination-port "$Portnummer" -j REJECT
[ $? -eq 0 ] || echo "ALERT! Firewall: UDP Ports nicht geschlossen!" && echo -n " ."
done
echo " OK"
}
function firewall_aus ()
{
iptables -F INPUT
[ $? -eq 0 ] || echo "Firewall NICHT ausgeschaltet!" && echo "Stopping Firewall"
}
function firewall_show_closed ()
{
iptables -L -n | grep "REJECT" | cut -d " " -f 33 | cut -d : -f 2
}
function firewall_show_running ()
{
nmap -sT localhost | grep open | cut -d / -f 1
nmap -sU localhost | grep open | cut -d / -f 1
}
function firewall_open ()
{
if [ $2 ]
then
iptables -D INPUT -i ppp0 -p udp --destination-port "$1" -j REJECT
else
iptables -D INPUT -i ppp0 -p tcp --destination-port "$1" -j REJECT
fi
}
function firewall_close ()
{
if [ $2 ]
then
iptables -I INPUT -i ppp0 -p udp --destination-port "$1" -j REJECT
else
iptables -I INPUT -i ppp0 -p tcp --destination-port "$1" -j REJECT
fi
}
case "$1" in
start)
firewall_ein
;;
stop)
firewall_aus
;;
restart)
$0 stop;
$0 start;
;;
show_closed)
firewall_show_closed
;;
show_running)
firewall_show_running
;;
show_open)
firewall_show_running > ./tmp_firewall_running
sort ./tmp_firewall_running > ./tmp_firewall_running.sort
firewall_show_closed > ./tmp_firewall_closed
sort ./tmp_firewall_closed > ./tmp_firewall_closed.sort
rm ./tmp_firewall_closed
rm ./tmp_firewall_running
diff ./tmp_firewall_closed.sort ./tmp_firewall_running.sort | grep ">" | cut -d " " -f 2
rm ./tmp_firewall_closed.sort ./tmp_firewall_running.sort
;;
open)
if [ ! $2 ]
then
$0 fehler;
exit 1
fi
if [ ! $3 ]
then
firewall_open $2
else
firewall_open $2 $3
fi
;;
close)
[ $2 ] || exit
[ $3 ] && firewall_close $2 $3 || firewall_close $2
;;
fehler)
echo "Verwendung: $0 start | stop | restart | open <Port> | close <Port> "
echo " | show_closed | show_running | show_open"
exit 1
;;
*)
echo "Verwendung: $0 start | stop | restart | open <Port> | close <Port> "
echo " | show_closed | show_running | show_open"
exit 1
esac
exit 0
Lichtbit