Hallo zusammen,
bei FTP + pf scheint es sich ja um ein häufigeres Problem zu handeln, doch haben mir diverse Threads hier leider nicht wirklich weitergeholfen.
Ausgangssituation:
Rechner mit einem genutzten Interface, auf welches 9 IPs geschaltet sind. 4 IPs für Jails, 4 externe IPs und 1 IP als Gateway für die Jails.
Firewall ist pf und die Jail IPs werden per NAT auf die ext. IPs gemappt.
Problem ist nun FTP. Habe schon ftpsesame und ftp-proxy genutzt. Leider ohne Erfolg. ftpsesame erlaubte zwar FTP Verbindung vom Host System aber nicht aus den Jails. ftp-proxy will momentan leider noch gar nicht so recht.
Meine pf.conf
ftp-proxy läuft auf Port 8021. FTP Verbindungen funktionieren leider nicht:
Irgendwelche Ideen? Was mach ich falsch?
Matthias
bei FTP + pf scheint es sich ja um ein häufigeres Problem zu handeln, doch haben mir diverse Threads hier leider nicht wirklich weitergeholfen.
Ausgangssituation:
Rechner mit einem genutzten Interface, auf welches 9 IPs geschaltet sind. 4 IPs für Jails, 4 externe IPs und 1 IP als Gateway für die Jails.
Firewall ist pf und die Jail IPs werden per NAT auf die ext. IPs gemappt.
Problem ist nun FTP. Habe schon ftpsesame und ftp-proxy genutzt. Leider ohne Erfolg. ftpsesame erlaubte zwar FTP Verbindung vom Host System aber nicht aus den Jails. ftp-proxy will momentan leider noch gar nicht so recht.
Meine pf.conf
Code:
# Lokale Interfaces
if0 = em0
if1 = em1
# Externe IPs
ext_main = 66.66.66.20
ext_postfix = 66.66.66.21
ext_dovecot = 66.66.66.22
ext_lighttpd = 66.66.66.23
ext_all = "{" $ext_main $ext_postfix $ext_dovecot $ext_lighttpd "}"
# Interne IPs
int_main = 10.0.0.10
int_postfix = 10.0.0.1
int_dovecot = 10.0.0.2
int_lighttpd = 10.0.0.3
int_mysql = 10.0.0.4
int_all = "{" $int_main $int_postfix $int_dovecot $int_lighttpd $int_mysql "}"
set block-policy return
set skip on lo0
# Pakete normalisieren
scrub in all
#### NAT ####
# FTP
nat-anchor "ftp-proxy/*"
# NAT fuer Jails
nat on $if0 proto {tcp udp icmp} from $int_mysql to any -> $ext_main
nat on $if0 proto {tcp udp icmp} from $int_postfix to any -> $ext_postfix
nat on $if0 proto {tcp udp icmp} from $int_dovecot to any -> $ext_dovecot
nat on $if0 proto {tcp udp icmp} from $int_lighttpd to any -> $ext_lighttpd
#### Redirects ####
# Redirect und erlaube SMTP/Submission auf Postfix Jail
rdr pass on $if0 proto tcp from any to $ext_postfix port 25 -> $int_postfix
rdr pass on $if0 proto tcp from any to $ext_dovecot port 25 -> $int_postfix port 587
# Redirect und erlaube POP3/IMAP auf Dovecot Jail
rdr pass on $if0 proto tcp from any to $ext_dovecot port {110 143} -> $int_dovecot
# Redirect und erlaube HTTP/HTTPS auf lighttpd Jail
rdr pass on $if0 proto tcp from any to $ext_lighttpd port {80 443} -> $int_lighttpd
# Redirect und erlaube MySQL auf MySQL Jail
rdr pass on $if0 proto tcp from 66.66.66.134 to $ext_main port 3306 -> $int_mysql
# FTP
rdr-anchor "ftp-proxy/*"
rdr pass on $if0 proto tcp from any to any port 21 -> 127.0.0.1 port 8021
#### Filter ####
# Alles verbieten
block all
# ICMP erlauben
pass inet proto icmp from any to any
# FTP
anchor "ftp-proxy/*"
pass out on $if0 proto tcp from 127.0.0.1 to any port 21 keep state
### restliche Filterregeln ausgeschnitten ###
ftp-proxy läuft auf Port 8021. FTP Verbindungen funktionieren leider nicht:
Code:
telnet ftp.suse.de 21
Trying 195.135.220.4...
telnet: connect to address 195.135.220.4: Operation not permitted
telnet: Unable to connect to remote host
Irgendwelche Ideen? Was mach ich falsch?
Matthias