PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Firewall



saulus
17.09.05, 18:57
Hallo,

ich möchte eine Firewall auf meinem Debian-Rechner installieren.
Das habe ich auch schon gemacht und es funktioniert soweit. Nur bekomme ich die Freigabe für die Internetnutzung meiner Clientrechner nicht hin. Sie sind an die Schnittstelle eth1 über einen Hub angeschlossen.

Hier die Ausgabe von iptables -L:

Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- localhost/24 anywhere tcp dpt:www
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp flags:!SYN,RST,ACK/SYN
ACCEPT all -- anywhere anywhere
ACCEPT udp -- localhost/24 anywhere udp dpt:domain
ACCEPT udp -- 195.50.140.0/24 anywhere
ACCEPT udp -- 195.50.140.0/24 anywhere
DROP all -- anywhere anywhere

Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT tcp -- localhost/24 anywhere tcp dpt:www
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp flags:!SYN,RST,ACK/SYN
ACCEPT udp -- localhost/24 anywhere udp dpt:domain
ACCEPT udp -- 195.50.140.0/24 anywhere
ACCEPT udp -- 195.50.140.0/24 anywhere
DROP all -- anywhere anywhere

Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- anywhere localhost/24 tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:www
ACCEPT tcp -- anywhere anywhere tcp flags:!SYN,RST,ACK/SYN
ACCEPT all -- anywhere anywhere
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT udp -- anywhere localhost/24
DROP all -- anywhere anywhere


Hat da wer ein geübtes Auge und kann mir sagen womit ich den http-Zugriff der Clientrechner immer noch blocke?


Gruß Saulus

cane
18.09.05, 13:09
ACCEPT tcp -- localhost/24 anywhere tcp dpt:www

localhost/24 sieht mir komisch aus...

Poste doch mal bitte das ganze Script - liest sich besser...

mfg
cane

saulus
18.09.05, 14:23
#!/bin/sh
#
#Firewall-Script
#
#firewal-iptables
#

#
#Packet-Forewarding aktivieren
#

echo 1 >/proc/sys/net/ipv4/ip_forward

#
# Alle bestehenden Regeln loeschen.
#

iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD

#
# Per Default wird der Zugriff komplett verboten
#

iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT


#
# http - Anfragen (Port 80) über eth0 zulassen
# an ippp0 SSH - Anfragen (Port 22) zulassen
# alle TCP - Antworten zulassen
# intern wird lo freigegeben
# DNS - Anfragen ins Internet (UDP-Port 53) und UDP-Daten vom Nameserver zulassen
# Alles andere loggen
#


#iptables -A INPUT -i eth1 -s 192.168.1.0/24 -p tcp --destination-port 80 -j ACCEPT
#iptables -A INPUT -i ippp0 -s 0.0.0.0/0 -p tcp --destination-port 22 -j ACCEPT
#iptables -A INPUT -p tcp ! --syn -j ACCEPT
#iptables -A INPUT -i lo -j ACCEPT
#iptables -A INPUT -i eth1 -s 192.168.1.0/24 -p udp --destination-port 53 -j ACCEPT
#iptables -A INPUT -i ippp0 -s 195.50.140.252/24 -p udp -j ACCEPT
#iptables -A INPUT -i ippp0 -s 195.50.140.250/24 -p udp -j ACCEPT
#iptables -A INPUT -s 0.0.0.0/0 -d 0.0.0.0/0 -j DROP




#iptables -A OUTPUT -o eth1 -d 192.168.1.0/24 -p tcp --destination-port 22 -j ACCEPT
#iptables -A OUTPUT -o ippp0 -d 0.0.0.0/0 -p tcp --destination-port 80 -j ACCEPT
#iptables -A OUTPUT -p tcp ! --syn -j ACCEPT
#iptables -A OUTPUT -o lo -j ACCEPT
#iptables -A OUTPUT -o ippp0 -d 0.0.0.0/0 -p udp --destination-port 53 -j ACCEPT
#iptables -A OUTPUT -o eth1 -d 192.168.1.0/24 -p udp -j ACCEPT
#iptables -A OUTPUT -s 0.0.0.0/0 -d 0.0.0.0/0 -j DROP


#
# SSH-Anfragen nach innen und HTTP-Anfragen nach aussen und alle TCP-Antworten durch den Rechner durchlassen
# Daten in das Internet maskieren
# DNS-Anfragen in das Internet (UDP-Port 53) und UDP-Daten vom Nameserver zulassen
# alles andere abweisen
#


#iptables -A POSTROUTING -t nat -o ippp0 -p tcp -j MASQUERADE
#iptables -A POSTROUTING -t nat -o ippp0 -p udp -j MASQUERADE
#iptables -A FORWARD -i eth1 -o ippp0 -s 192.168.1.0/24 -p tcp --destination-port 80 -j ACCEPT
#iptables -A FORWARD -i ippp0 -o eth1 -s 0.0.0.0/0 -p tcp --destination-port 22 -j ACCEPT
#iptables -A FORWARD -p tcp ! --syn -j ACCEPT
#iptables -A FORWARD -i eth1 -o ippp0 -s 192.168.1.0/24 -p udp --destination-port 53 -j ACCEPT
#iptables -A FORWARD -i ippp0 -o eth1 -s 195.50.140.252/24 -p udp -j ACCEPT
#iptables -A FORWARD -i ippp0 -o eth1 -s 195.50.140.250/24 -p udp -j ACCEPT
#iptables -A FORWARD -s 0.0.0.0/0 -d 0.0.0.0/0 -j DROP

himbeere
18.09.05, 16:10
#
# Per Default wird der Zugriff komplett verboten
#

iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

Aha. Dann solltest Du das auf "DROP" setzen. :-)