Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.4k views
in Java FTP by (120 points)
Hi,

is it possible to set the local port range for a passive ftp connection on the client side?
I tried to set it via setActivePortRange(2500,2600) but this doesn't seem to work. I guess
the method does something else.

Background:
I would like to restrict the port range to a special value, because I can explicity
allow this range in my firewall rules. That means, that ftp can only be used by programs which know
the local port range.

e.g.:

PF (Firewall) (OpenBSD) http://www.openbsd.org/faq/pf/

pass in on $int_if proto tcp from $int_net port 2500:2600 to any modulate state
pass out on $ext_if proto tcp from $ext_ip port > 10000 to any port > 10000 modulate state

1 Answer

0 votes
by (162k points)
setActivePortRange(2500,2600) is what you need. If it isn't working for you, can you post a small relevant portion of the log file?

Categories

...