kosovafan
Well-Known Member
Hallo,
ich bin gerade dabei mich mit dem IPfilter zu beschäftigen. Jetzt hatte ich zwei Scripts am laufen, die mich aussperrten. Nach ein paar Stunden lief der Server wieder.
Jetzt habe ich doch einmal die dumme Frage. Ich habe das ganze erst einmal mit Webmin getestet, das läuft aber irgendwie gar nicht, dann nach Wiki Eintrag, was auch nicht wirklich lief. Jetzt habe ich mich mal mit den Handbuch beschäftigt und verstehe das so:
Ich sperre erst alles, dann gebe ich lokal alles frei und muß für jeden Dienst entsprechende Regeln setzen. Muss ich für jeden Dienst in/out setzen?
Das war der erste Versuch, im Portscan war aber nur 25/443/993 zu erreichen. Nach den Handbuch verstehe ich das jetzt so:
Oder muss ich für jeden Dienst in/out setzen? Normalerweise liefert und empfängt ja nur Nginx und Postfix. Dovecot kann nur für den Abruf genutzt werden, genauso wie SSH. Oder verstehe ich alles total verkehrt?
Ich bräuchte die Firewall, weil ich nach suchen im Netz damit die einzige Möglichkeit habe, Mysql nur für eine bestimmte IP freizugeben. Wenn ich das damit erreiche kann der Mailserver wirklich nur für Emails dienen, Webmail, Spam und Admin kann dann auf den normalen Server untergebracht werden.
Würde mich über einen Wink des Wissens freuen. Vielen Dank.
Silvio
ich bin gerade dabei mich mit dem IPfilter zu beschäftigen. Jetzt hatte ich zwei Scripts am laufen, die mich aussperrten. Nach ein paar Stunden lief der Server wieder.
Jetzt habe ich doch einmal die dumme Frage. Ich habe das ganze erst einmal mit Webmin getestet, das läuft aber irgendwie gar nicht, dann nach Wiki Eintrag, was auch nicht wirklich lief. Jetzt habe ich mich mal mit den Handbuch beschäftigt und verstehe das so:
Ich sperre erst alles, dann gebe ich lokal alles frei und muß für jeden Dienst entsprechende Regeln setzen. Muss ich für jeden Dienst in/out setzen?
Code:
#Alles blocken
block in on re0
block out on re0
#Loopback freischalten
pass in quick on lo0
pass out quick on lo0
# TCP, UDP, ICMP
pass out on re0 proto tcp from any to any flags S keep state
pass out on re0 proto udp from any to any keep state
pass out on re0 proto icmp from any to any keep state
# SSH
pass in on re0 proto tcp from any to any port = 1000 keep state
# Nginx
pass in on re0 proto tcp from any to any port = 80 keep state
# Nginx/SSL
pass in on re0 proto tcp from any to any port = 443 keep state
# POP3-SSL
pass in on re0 proto tcp from any to any port = 995 keep state
# Imap-SSL
pass in on re0 proto tcp from any to any port = 993 keep state
# SMTP
pass in on re0 proto tcp from any to any port = 25 keep state
# SMTP-SSL
pass in on re0 proto tcp from any to any port = 465 keep state
Das war der erste Versuch, im Portscan war aber nur 25/443/993 zu erreichen. Nach den Handbuch verstehe ich das jetzt so:
Code:
oif="re0" #Out Networkcard
odns="213.133.98.98" #Nameserver
myip="78.47.240.30" #Static IP
ks="keep state"
fks="flags S keep state"
#All Block
block in on re0 all
block out on re0 all
#Local
pass in quick on lo0 all
pass out quick on lo0 all
# Allow out access to ISP
pass out quick on $oif proto tcp from any to $odns port = 53 $fks
pass out quick on $oif proto udp from any to $odns port = 53 $ks
#www
pass out quick on $oif proto tcp from $myip to any port = 80 $fks
#www-secure
pass out quick on $oif proto tcp from $myip to any port = 443 $fks
#ssh
pass out quick on $oif proto tcp from $myip to any port = 1000 $fks
#IMAP
pass out quick on $oif proto tcp from $myip to any port = 993 $fks
#POP
pass out quick on $oif proto tcp from $myip to any port = 995 $fks
#SMTP
pass out quick on $oif proto tcp from $myip to any port = 25 $fks
pass in quick on $oif proto tcp from $myip to any port = 25 $fks
#SMTP-SSL
pass out quick on $oif proto tcp from $myip to any port = 465 $fks
pass in quick on $oif proto tcp from $myip to any port = 465 $fks
Oder muss ich für jeden Dienst in/out setzen? Normalerweise liefert und empfängt ja nur Nginx und Postfix. Dovecot kann nur für den Abruf genutzt werden, genauso wie SSH. Oder verstehe ich alles total verkehrt?
Ich bräuchte die Firewall, weil ich nach suchen im Netz damit die einzige Möglichkeit habe, Mysql nur für eine bestimmte IP freizugeben. Wenn ich das damit erreiche kann der Mailserver wirklich nur für Emails dienen, Webmail, Spam und Admin kann dann auf den normalen Server untergebracht werden.
Würde mich über einen Wink des Wissens freuen. Vielen Dank.
Silvio