Probleme mit der neuen nat Sysntax von OpenBSD 4.7

hal9000

Member
Hallo,

ich habe (in einer Testumgebung) von 4.6 auf 4.7 aktualisiert.

in der pf.conf habe ich folgende Eintraege stehen:

# OpenBSD 4.6
no rdr on $extif proto tcp from <spamd-white> to any port smtp
rdr pass on $extif proto tcp from <whitelist> to $extif port smtp -> 127.0.0.1 port smtp
rdr pass on $extif proto tcp from any to any port smtp -> 127.0.0.1 port spamd
rdr pass on $extif proto tcp from <blacklist> to $extif port smtp -> 127.0.0.1 port spamd

Das wollte ich auf 4.7 anpassen:
# OpenBSD 4.7
pass in log on $extif inet proto tcp from <spamd-white> to ($extif) port smtp synproxy state rdr-to lo0
pass in log on $extif inet proto tcp from !<spamd-white> to ($extif) port smtp synproxy state rdr-to lo0 port spamd

Leider funktioniert es so nicht. Wo habe ich den Denkfehler?
 
hallo nagel,

danke fuer die schnelle Antwort. Ich habe das Beispiel versucht. Doch statt mit
dem SPAMD verbunden zu werden, lande ich bei einem Test direkt auf dem MTA
Port 25.

Ich habe folgendes in der pf.conf eingetragen:
(blackllist verwendete ich unter 4.6)

# tables
table <spamd-white> persist
table <whitelist> persist file "/etc/mail/whitelist.txt"
table <blacklist> persist file "/etc/mail/blacklist.txt"

# SPAM handling
pass in log on egress proto tcp from any to any port smtp rdr-to 127.0.0.1 port spamd
pass in log on egress proto tcp from <whitelist> to any port smtp
pass in log on egress proto tcp from <spamd-white> to any port smtp
pass out log on egress proto tcp to any port smtp

Funktoniert trotzdem nicht. Die IP von der ich komme ist nicht in der whitelist und auch
nicht in der spamdb.
 
Ich habe die Regeln ans Ende der pf.conf gestellt und nun klappt es scheinbar.

Die pf.conf sieht so aus (alle Kommentare entfernt, sonst aber komplett und
in dieser Reihenfolge). Ist das nun "last match" bei den pf Regeln in Version 4.7?

Code:
extif="em0"
loif="lo0"

set skip on lo

table <spamd-white> persist
table <whitelist> persist file "/etc/mail/whitelist.txt"
table <blacklist> persist file "/etc/mail/blacklist.txt"

icmp_types = "{ echoreq, unreach }"

block log all label block.all


block drop in log quick from <ssh-bruteforce> to any
pass in log quick proto tcp from any to any port ssh flags S/SA keep state (max-src-conn-rate 3/30,overload <ssh-bruteforce> flush global)

pass in quick on $extif inet proto icmp
pass inet proto icmp all icmp-type $icmp_types keep state

block in
pass in on $extif inet proto tcp from any to any port smtp
pass out keep state

pass in log on $extif proto tcp from any to $extif port smtp rdr-to 127.0.0.1 port spamd
pass in log on $extif proto tcp from <whitelist>   to any port smtp
pass in log on $extif proto tcp from <spamd-white> to any port smtp
pass out log on $extif proto tcp to any port smtp
 
Zurück
Oben