|
iptables problem (Georg Prager, 19.12.2002, 10:59)
Hallo Leute!
Hab da ein Problem bei meiner iptables Konfiguration, und komm einfach auf den
Fehler nicht drauf.
Mein Netz:
192.168.5.0/24 --- eth1 192.168.5.1 eth0(ppp0) 1.2.3.4 --- Internet
Der Server hat die interne IP-Adresse 192.168.5.1 und w?hlt sich ?ber das
ADSL-Modem, welches an eth0 h?ngt ins Internet ein, wobei ppp0 erstellt wird.
Folgendes hab ich mit iptables schon konfiguriert und funktioniert auch:
INPUT, FORWARD, OUTPUT, PREROUTING, POSTROUTING sind momentan auf ACCEPT
#masq
iptables -t nat -A POSTROUTING -s 192.168.5.0/30 -o ppp0 -j SNAT \
--to-source 1.2.3.4
#localhost und internes Netz
iptables -A INPUT -s localhost -j ACCEPT
iptables -A INPUT -s 192.168.5.0/30 -j ACCEPT
#eth0 zum Modem
iptables -A INPUT -s 10.0.0.0/8 -j ACCEPT
iptables -A INPUT -p icmp -j ACCEPT
Soweit so gut. Nun m?chte ich, dass ?ber das Internet nur bestimmte Services
verwendbar sind. Zum Beispiel: Domain - Abfragen
iptables -A INPUT -i ppp0 -p tcp --sport domain -j ACCEPT
iptables -A INPUT -i ppp0 -p udp --sport domain -j ACCEPT
Sobald ich jetzt den Befehl
iptables -P INPUT DROP
ausf?hre, um die restlichen Dienste zu sperren, sollte ich von Extern bis auf
DNS auf kein Service mehr zugreifen k?nnen. Leider ist das nicht so.
DNS funktioniert nicht, daf?r sind (siehe nmap) 2 andere Ports offen.
nmap von externen Computer:
nmap 1.2.3.4 -p 1-1024
(The 1022 ports scanned but not shown below are in state: filtered)
Port State Service
80/tcp open http
554/tcp open rtsp
Hoffentlich kann mir irgendwer dabei weiterhelfen!
Georg
|