FTP - allowing only certin ip's/subnets

fds09w4jih4r

Dabbler
Joined
Apr 4, 2019
Messages
44
Since we require an anonymous config for our FTP client. This presents security issues of course. Is there some way to allow only certain IP's or IP ranges to access the FTP port?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399

fds09w4jih4r

Dabbler
Joined
Apr 4, 2019
Messages
44
Similarly, any firewall device should make it relatively easy to limit access via its own configurations. If it were me, I would do both.

That's, not an option here.. The goal here is to restrict to the lab machines and not expose the machine to the wider corp network..
 

Fredda

Guru
Joined
Jul 9, 2019
Messages
608
That's, not an option here.. The goal here is to restrict to the lab machines and not expose the machine to the wider corp network..
Why not? Depends a little bit what you understand when talking about firewall. You could use the included packetfilter.
Assuming your LAB machines are in the 192.168.1.1/24 range:
Code:
ipfw -q add 1000 allow ip from 192.168.1.1/24 to any 21 in
ipfw -q add 1002 deny ip from any to any 21 in
Untested. Use at your own risk. This won't survive a reboot but you can but it in a postinit script in the tasks section.
 
Last edited:

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Does this survive system reboots? service restarts? Possibly not, but I can utilize it none the less..

Yes to both, as adding this via the GUI means this setting is saved in the FreeNAS database.
 

fds09w4jih4r

Dabbler
Joined
Apr 4, 2019
Messages
44
Yes to both, as adding this via the GUI means this setting is saved in the FreeNAS database.

This doesn't really work.. Since when you paste the correct line in, you do see it show up in the ./etc/local/proftpd.conf fine.. Then when you restart the service its still there.. But the same rule, allowing everything is already higher up in the file and likely this we are putting isn't taking effect... It would be good to know where the proftp is pulling its new settings from upon a restart of the service...
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Top