Crontab Anliegen

01/26/2016 22:26 Chaosnightx3#1
Servus,
besteht die Möglichkeit, dass mir jemand
ein Crontab Script erstellt, welches den Befehl "service pf reload" alle 2 Minuten läd? Liebe Grüße.
01/26/2016 22:37 HighWave#2
Quote:
Originally Posted by Chaosnightx3 View Post
Servus,
besteht die Möglichkeit, dass mir jemand
ein Crontab Script erstellt, welches den Befehl "service pf reload" alle 2 Minuten läd? Liebe Grüße.
Wo liegt denn dein Problem ?
01/26/2016 22:45 Chaosnightx3#3
Quote:
Originally Posted by HighWave View Post
Wo liegt denn dein Problem ?

Meine Homepage ist mit meinem Datenbankserver verknüpft, ist ja wohl logisch...
nur rückt diese alle 3 Minuten einen 500 Internal Server error raus. Und wenn ich die Firewall neuladen, geht die Homepage wieder... Deswegen mein Anliegen.
01/26/2016 22:49 Wayne3#4
2 * * * * service pf reload

?? ^^
01/26/2016 22:50 Chaosnightx3#5
Quote:
Originally Posted by Wayne3 View Post
2 * * * * service pf reload

?? ^^
Fehlt da nicht was? o_O

Edit: Klappt.
01/27/2016 12:06 blackout85#6
ist aber ein schlechter weg?

warum setzt du in der pf nicht einfach die IP´s auf die Whitelist?
01/27/2016 12:15 #dynastie#7
Quote:
Originally Posted by blackout85 View Post
ist aber ein schlechter weg?

warum setzt du in der pf nicht einfach die IP´s auf die Whitelist?
Metin2-Szene eben. Juckt doch keinen, hauptsache man "umgeht" das Problem. Immer schön kontraproduktiv arbeiten :D
01/27/2016 12:38 blackout85#8
yoar leider wird es so gemacht.

Schlimmer finde ich aber die copy paste Fehler wo das unglaubliche "ich habe nichts geändert" Phänomen auftritt :P

Ich tippe bei diesem Fall hier eher auf die max_connections der mysql. bzw das wird das nächste Problem sein.
01/27/2016 12:45 #dynastie#9
@TE:
Probiers hiermit. Musst natürlich dein Interface und deine Ports anpassen. Kannst dann auch deinen Webserver bspw. whitelisten.

PHP Code:
# Change the value to reflect your public interface. You can see this with ifconfig.
ext_if="em0"
     
# IP addresses that should override the firewall rules, such as your web server.
table <trusted_hosts> const { 8.8.8.8 8.8.4.4 }

# Ports used for services (SSH, MySQL)
service_ports="{ 22 3306 }"
     
# Ports used by Metin2
game_ports="{ 11002 13000 13002 }"

# Sets the interface for which PF should gather statistics such as bytes in/out and packets passed/blocked. Statistics can only be gathered for one interface at a time. 
set loginterface $ext_if

#Skip all PF processing on interface. This can be useful on loopback interfaces where filtering, normalization, queueing, etc, are not required. This option can be used multiple times. By default this option is not set. 
set skip on lo
    
# Table for abusive hosts        
table <abusive_hostspersist

# Block these bastards.
block in quick from <abusive_hosts>

# Schutz gegen gefälschte Adressen für Alle Interfaces aktivieren
block in quick from urpf-failed

# block anything coming from sources that we have no back routes for.
block in from no-route to any

# Rate limits, trial and error (service ports)
pass in on $ext_if proto tcp to any port $service_ports flags S/SA keep state \
       (
max-src-conn 30max-src-conn-rate 5/15overload <abusive_hostsflush)
     
# Rate limits, trial and error (metin2 ports)
pass in on $ext_if proto {tcp,udpto any port $game_ports flags S/SA keep state \
       (
max-src-conn 30max-src-conn-rate 5/15overload <abusive_hostsflush)
       

# Allow whitelist override the firewall rules.       
pass in quick from <trusted_hosts>

pass out all keep state
pass out on $ext_if all modulate state
     
# Allow ping in
pass in inet proto icmp all icmp-type echoreq