Hilfeeeeeee???!!!

hm, hast du das interface mal ganz weggelassen?
 
nein ich meine

# HTTP
iptables -A INPUT -i ppp0 -m state --state NEW -p tcp --dport 80 -j ACCEPT

so steht das in deinen regeln und du sollst das -i ppp0 ganz rausnehmen

# HTTP
iptables -A INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT

und das in allen regeln, wo es drin vorkommt
 
hm, und eth0 ging auch nicht?

poste mal die ausgabe von

ifconfig
 
ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:146 (146.0 b) TX bytes:146 (146.0 b)

venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.1 P-t-P:127.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.0
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:262 errors:0 dropped:0 overruns:0 frame:0
TX packets:323 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:20565 (20.0 Kb) TX bytes:26109 (25.4 Kb)

venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:62.75.168.75 P-t-P:62.75.168.75 Bcast:62.75.168.75 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:262 errors:0 dropped:0 overruns:0 frame:0
TX packets:323 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:20565 (20.0 Kb) TX bytes:26109 (25.4 Kb)
 
hm, venet0 hab ich noch nie gesehen.

also in die entsprechenden regeln folgendes rein

# ssh
iptables -A INPUT -i venet0:0 -m state --state NEW -p tcp --dport 22 -j ACCEPT

hoffe mal das das so geht
 
Moin.....
....bevor ich das jetzt mache - was sage ich der Firewall überhaupt damit?
venet0:0 ? --state NEW?
 
hi

# ssh
iptables -A INPUT -i venet0:0 -m state --state NEW -p tcp --dport 22 -j ACCEPT

erlaube alle neuen(NEW) pakete in der input chain die am interface venet0:0 *auftauchen* und die den zielport 22(ssh) haben, sowie tcp pakete sind.
 
ahhh - aber nochwas: gestern war der server ja nicht mehr erreichbar nachdem ich die Firewall eingeschltet hab - auch http nicht - muß ich das für http auch machen??
 
ja für alle *sachen* die von aussen erreichbar sein sollen, also http, https, mail ?

am wichtigsten ist aber ssh erstmal
 
....so hab ich gemacht....und dann:

/etc/init.d/firewall.sh start
Starte IP-Paketfilter
/etc/init.d/firewall.sh: line 25: modprobe: command not found
/etc/init.d/firewall.sh: line 27: modprobe: command not found
/etc/init.d/firewall.sh: line 29: modprobe: command not found
/etc/init.d/firewall.sh: line 30: modprobe: command not found
iptables v1.2.7a: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.2.7a: can't initialize iptables table `mangle': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.2.7a: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.2.7a: can't initialize iptables table `mangle': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
 
du solltest doch die zeilen mit modprobe auskommentieren
 
....hab ich gemacht!


# iptables-Modul
# modprobe ip_tables
# Connection-Tracking-Module
# modprobe ip_conntrack
# Das Modul ip_conntrack_irc ist erst bei Kerneln >= 2.4.19 verfuegbar
# modprobe ip_conntrack_irc
# modprobe ip_conntrack_ftp
 
Zuletzt bearbeitet:
und die fehlermeldungen kommen trotzdem?
 
folgende Fehlermeldung:

# /etc/init.d/firewall.sh start
Starte IP-Paketfilter
/etc/init.d/firewall.sh: line 25: modprobe: command not found
/etc/init.d/firewall.sh: line 27: modprobe: command not found
/etc/init.d/firewall.sh: line 29: modprobe: command not found
/etc/init.d/firewall.sh: line 30: modprobe: command not found
iptables v1.2.7a: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.2.7a: can't initialize iptables table `mangle': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.2.7a: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
iptables v1.2.7a: can't initialize iptables table `mangle': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

...nur reboot ist möglich
Habs auch mit venet0 anstelle venet0:0 versucht
 
hm, is mir ehrlich gesagt nen rätsel, warum da immer noch fehlermeldungen bezüglich modprobe kommen, wenn du es auskommentiert hast.

bezüglich dem interface würde ich mal vorschlagen, du setzt dich mit dem support mal in verbindung und fragst die, ob es überhaupt möglich ist, auf der kiste nen eigenes iptables script laufen zu lassen. die regeln sollten eigentlich richtig sein.

ps: poste nochmal das script wie es momentan ist, eventuell fällt mir ja noch was auf.


Gruß HL
 
Also der Kai Suesse ( server4you support ) schrieb n´mir ich solle den server mit ner firewall sichern und solle mich zum Thema IPTABLES schlau machen.....


Hier das script:

cat firewall.sh
#!/bin/bash
# ---------------------------------------------------------------------
# Linux-iptables-Firewallskript, Copyright (c) 2004 under the GPL
# Autogenerated by iptables Generator v1.16 (c) 2002 by Harald Bertram*
# Please visit http://www.harry.homelinux.org for new versions of
# the iptables Generator (c).
#
# This Script was generated by request from:
# ********** on: 2004-4-15 20:34.27 MET.
#
# If you have questions about the iptables Generator or about
# your Firewall-Skript feel free to take a look at out website or
# send me an E-Mail to **********.
#
# My special thanks are going to Lutz Heinrich (trinitywork@hotmail.com) who
# made lots of Beta-Testing and gave me lots of well qualified
# Feedback that made me able to improve the iptables Generator.
# --------------------------------------------------------------------

case "$1" in
start)
echo "Starte IP-Paketfilter"

# iptables-Modul
# modprobe ip_tables
# Connection-Tracking-Module
# modprobe ip_conntrack
# Das Modul ip_conntrack_irc ist erst bei Kerneln >= 2.4.19 verfuegbar
# modprobe ip_conntrack_irc
# modprobe ip_conntrack_ftp

# Tabelle flushen
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
iptables -t nat -X
iptables -t mangle -X

# Default-Policies setzen
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP

# MY_REJECT-Chain
iptables -N MY_REJECT

# MY_REJECT fuellen
iptables -A MY_REJECT -p tcp -m limit --limit 7200/h -j LOG --log-prefix "RE
JECT TCP "
iptables -A MY_REJECT -p tcp -j REJECT --reject-with tcp-reset
iptables -A MY_REJECT -p udp -m limit --limit 7200/h -j LOG --log-prefix "RE
JECT UDP "
iptables -A MY_REJECT -p udp -j REJECT --reject-with icmp-port-unreachable
iptables -A MY_REJECT -p icmp -m limit --limit 7200/h -j LOG --log-prefix "D
ROP ICMP "
iptables -A MY_REJECT -p icmp -j DROP
iptables -A MY_REJECT -m limit --limit 7200/h -j LOG --log-prefix "REJECT OT
HER "
iptables -A MY_REJECT -j REJECT --reject-with icmp-proto-unreachable

# MY_DROP-Chain
iptables -N MY_DROP
iptables -A MY_DROP -m limit --limit 7200/h -j LOG --log-prefix "PORTSCAN DR
OP "
iptables -A MY_DROP -j DROP

# Alle verworfenen Pakete protokollieren
iptables -A INPUT -m state --state INVALID -m limit --limit 7200/h -j LOG --
log-prefix "INPUT INVALID "
iptables -A OUTPUT -m state --state INVALID -m limit --limit 7200/h -j LOG -
-log-prefix "OUTPUT INVALID "

# Korrupte Pakete zurueckweisen
iptables -A INPUT -m state --state INVALID -j DROP
iptables -A OUTPUT -m state --state INVALID -j DROP

# Stealth Scans etc. DROPpen
# Keine Flags gesetzt
iptables -A INPUT -p tcp --tcp-flags ALL NONE -j MY_DROP

# SYN und FIN gesetzt
iptables -A INPUT -p tcp --tcp-flags SYN,FIN SYN,FIN -j MY_DROP

# SYN und RST gleichzeitig gesetzt
iptables -A INPUT -p tcp --tcp-flags SYN,RST SYN,RST -j MY_DROP

# FIN und RST gleichzeitig gesetzt
iptables -A INPUT -p tcp --tcp-flags FIN,RST FIN,RST -j MY_DROP

# FIN ohne ACK
iptables -A INPUT -p tcp --tcp-flags ACK,FIN FIN -j MY_DROP

# PSH ohne ACK
iptables -A INPUT -p tcp --tcp-flags ACK,PSH PSH -j MY_DROP

# URG ohne ACK
iptables -A INPUT -p tcp --tcp-flags ACK,URG URG -j MY_DROP

# Loopback-Netzwerk-Kommunikation zulassen
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

# Connection-Tracking aktivieren
iptables -A OUTPUT -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# HTTP
iptables -A INPUT -i venet0:0 -m state --state NEW -p tcp --dport 80 -j ACCE
PT

# HTTPS
iptables -A INPUT -i venet0:0 -m state --state NEW -p tcp --dport 443 -j ACC
EPT

# SMTP
iptables -A INPUT -i venet0:0 -m state --state NEW -p tcp --dport 25 -j ACCE
PT

# POP3
iptables -A INPUT -i venet0:0 -m state --state NEW -p tcp --dport 110 -j ACC
EPT

# POP3S
iptables -A INPUT -i venet0:0 -m state --state NEW -p tcp --dport 995 -j ACC
EPT

# DNS
iptables -A INPUT -i venet0:0 -m state --state NEW -p tcp --dport 53 -j ACCE
PT
iptables -A INPUT -i venet0:0 -m state --state NEW -p udp --dport 53 -j ACCE
PT

# FTP
iptables -A INPUT -i venet0:0 -m state --state NEW -p tcp --dport 21 -j ACCE
PT

# SSH
iptables -A INPUT -i venet0:0 -m state --state NEW -p tcp --dport 22 -j ACCE
PT

# MYSQL
iptables -A INPUT -i eth0 -m state --state NEW -p tcp --dport 3306 -j ACCEPT

# TELNET
iptables -A INPUT -i eth0 -m state --state NEW -p tcp --dport 23 -j ACCEPT

# Default-Policies mit REJECT
iptables -A INPUT -j MY_REJECT
iptables -A OUTPUT -j MY_REJECT

# Max. 500/Sekunde (5/Jiffie) senden
echo 5 > /proc/sys/net/ipv4/icmp_ratelimit

# Speicherallozierung und -timing für IP-De/-Fragmentierung
echo 262144 > /proc/sys/net/ipv4/ipfrag_high_thresh
echo 196608 > /proc/sys/net/ipv4/ipfrag_low_thresh
echo 30 > /proc/sys/net/ipv4/ipfrag_time

# TCP-FIN-Timeout zum Schutz vor DoS-Attacken setzen
echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout

# Maximal 3 Antworten auf ein TCP-SYN
echo 3 > /proc/sys/net/ipv4/tcp_retries1

# TCP-Pakete maximal 15x wiederholen
echo 15 > /proc/sys/net/ipv4/tcp_retries2

;;

stop)
echo "Stoppe IP-Paketfilter"
# Tabelle flushen
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
iptables -t nat -X
iptables -t mangle -X
echo "Deaktiviere IP-Routing"
echo 0 > /proc/sys/net/ipv4/ip_forward

# Default-Policies setzen
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
;;

status)
echo "Tabelle filter"
iptables -L -vn
echo "Tabelle nat"
iptables -t nat -L -vn
echo "Tabelle mangle"
iptables -t mangle -L -vn
;;

*)
echo "Fehlerhafter Aufruf"
echo "Syntax: $0 {start|stop|status}"
exit 1
;;

esac
 
also das script sieht eigentlich gut aus so. nen paar kleinigkeiten wären noch zu ändern, die aber erstmal nicht so wichtig sind.

es kann eigentlich nur am falschen interface liegen. frag ihn am besten mal, was du als input interface nehmen sollst.
 
ich nochmal, hab eben mal deinen server gescannt und danach ist auch nur das *offen* was laut iptables script erlaubt wurde.

Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
Interesting ports on 168075.vserver.de (62.75.168.75):
(The 1593 ports scanned but not shown below are in state: closed)
Port State Service
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
80/tcp open http
110/tcp open pop-3
443/tcp open https
995/tcp open pop3s
3306/tcp open mysql
 

Ähnliche Themen

[HowTo] TeamSpeak 2 - RC2 - Server (Deutsch/Englisch)

Zurück
Oben