Iptables - Konfiguration - apt-get funktioniert nicht mehr :(

F

floh102

Jungspund
also ich bin gerade dabei ein iptables-script zu konfigurieren
das geht auch ganz gut :)

EDIT:// habs gelöst - sry dass ich zu schnell gepostet hab *g*
könntet ihr vllt doch noch en blick auf mein script werfen?

Code:
#Standard - Alles verbieten
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

#Tabellen leeren
iptables -F
iptables -X

#Spezielle Regeln
#SSH
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
#Apache2
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p udp --dport 80 -j ACCEPT
#FTP
iptables -A INPUT -p tcp --dport 20 -j ACCEPT
iptables -A INPUT -p tcp --dport 21 -j ACCEPT

#DNS
iptables -A INPUT -p tcp --sport 53 -j ACCEPT
iptables -A INPUT -p udp --sport 53 -j ACCEPT

#Ping
iptables -A INPUT -p icmp -j ACCEPT

#Loop
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

Edit:// iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

ich will alles sperren außer, ssh, www und ftp und den ping

problem ich kann jez nicht mehr apt-get update ausführen

Code:
root@server:~# apt-get update
0% [Verbinde mit de.archive.ubuntu.com (141.76.2.3)]

ich hab mal (zum testen) alles ankommende aktzeptiert - dann gehts, aber das will ich ja net :think:

wenn ich netstat ausführe kommt folgender eintrag

Code:
tcp        0      1 static-ip-xx-xx-xx:56210 ftp.inf.tu-dresden.:www SYN_SENT

also ich schließe daraus, dass die firewall die pakete nicht auf dem zufälligen port (hier 56210) annimmt, aber ich komm nich weiter :(
vllt ist auch mein script fehlerhaft ?

thx im voraus :)
 
Zuletzt bearbeitet:
#Standard - Alles verbieten
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

für apt, mach ma noch
Code:
iptables -A OUTPUT -p tcp --dport 20 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 21 -j ACCEPT
 
Code:
#Standard - Alles verbieten
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP

#Tabellen leeren
iptables -F
iptables -X

#Spezielle Regeln
#SSH
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 22 -j ACCEPT
#Apache2
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
#WWW
iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT
#FTP
iptables -A INPUT -p tcp --dport 20 -j ACCEPT
iptables -A INPUT -p tcp --dport 21 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 20 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 21 -j ACCEPT

#DNS
iptables -A OUTPUT -p udp --dport 53 -j ACCEPT

#Ping
iptables -A INPUT -p icmp --icmp-type 8 -j ACCEPT
iptables -A OUTPUT -p icmp --icmp-type 8 -j ACCEPT

#Loop
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

thx :) - stimmt so isses sicherer :)

p.s.: danke für die schnelle antwort :)
 
jo :)

danke, es lag daran dass ich keine eingehenden verbindungen von bestehenden verbindungen erlaubt habe

"iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT"

jetzt gehts :)

thx für deine hilfe :)
 

Ähnliche Themen

Port Forwarding mit iptables

ip6tables Problem

iptables verständniss frage, xrdp nicht erreichbar.

[SOLVED][CentOS 7] Samba server nicht erreichbar trotz firewall regeln.

iptables blocke nur von bestimmter ip

Zurück
Oben