OPNsense Forum

English Forums => 26.1, 26,4 Series => Topic started by: loiclegarrec56 on September 25, 2026, 05:31:29 PM

Title: Legacy FTP ON 26.X BE
Post by: loiclegarrec56 on September 25, 2026, 05:31:29 PM
Hello,

I am using OPNsense Business Edition.

Version: 26.4.2p2
Edition: opnsense-business

I need to connect to external FTP servers from my internal network.

From what I understand, since the 26.x versions, the FTP proxy (os-ftp-proxy) needs to be installed/configured for FTP connections to work correctly.

I have installed the FTP proxy, but I am not sure how to configure the required NAT/firewall rules so that FTP connections from my internal clients can pass through OPNsense correctly.

I also noticed something that may be related to the issue:

Existing/old aliases that were already configured before the upgrade still work correctly.
Newly created aliases do not seem to work.
This makes me wonder if there is a specific configuration or NAT requirement for newly created aliases in the 26.x Business Edition.

Could someone please clarify:

How should os-ftp-proxy be configured on OPNsense Business Edition 26.4.2p2?
Which NAT rules are required?
Which firewall rules are required?
Do the FTP clients need to be explicitly configured to use the proxy?
Is there any known issue with newly created aliases in version 26.4.2p2?
Is there anything specific that needs to be done for newly created aliases to become available to NAT/firewall rules?

My goal is to allow internal clients to connect to external FTP servers through OPNsense.

Thank you.
Title: Re: Legacy FTP ON 26.X BE
Post by: meyergru on September 25, 2026, 06:17:23 PM
The official documentation (https://forum.opnsense.org/index.php?topic=3868.0) currently does not describe the complete setup of os-ftp-proxy and the old how-to (https://forum.opnsense.org/index.php?topic=3868.0) explains the concept, but it is about 10 years old and the screenshots are no longer available.

The current documentation only mentions the basic principle.

The important missing step is that merely enabling the FTP proxy service is not enough. For a transparent forward proxy you also need a NAT port-forward rule for the FTP control connection, for example:

Interface:        LAN
Protocol:         TCP
Source:           LAN net
Destination:      any
Destination port: 21

Redirect target:  127.0.0.1
Redirect port:    8021

With the proxy enabled on 127.0.0.1:8021, but without that redirect, active FTP failed here exactly as expected:

> EPRT |1|192.168.10.97|22827|
< 425 Connections to other hosts not allowed.

After adding the redirect rule, the same active FTP test worked immediately.

The proxy handles PORT/EPRT, substitutes an externally reachable endpoint and dynamically creates the required PF rules for the incoming FTP data connection. Therefore no permanent WAN rule for the FTP data ports is required.

This can easily be tested against the public Rebex FTP test server (https://test.rebex.net):

curl.exe -v --ftp-port - --user demo:password ftp://test.rebex.net/pub/example/readme.txt

Important limitation: this only works for plain, unencrypted FTP.

It cannot work for FTPS/TLS, because once the FTP control connection is encrypted, ftp-proxy can no longer inspect or rewrite commands such as PORT, EPRT, PASV or EPSV, nor derive the required dynamic firewall rules from them.

The underlying ftp-proxy behaviour is documented here (https://man.openbsd.org/ftp-proxy).


So I think the current OPNsense documentation should explicitly include

Title: Re: Legacy FTP ON 26.X BE
Post by: nero355 on September 25, 2026, 10:35:53 PM
Is all of this seriously needed ?!

I have never had to do anything like that behind other NAT Routers to connect to Public FTP Servers or for example one temporarily hosted by a friend or me to transport some stuff between our networks.

The only thing that I can think of being different at the time compared to OPNsense now is the needed for STRICT-PORT NAT functionality being ENABLED for the specific Subnet(s) or Client(s) but that's about it...

Usually Passive FTP Mode was used behind NAT and nothing more than that was ever needed ?!
Title: Re: Legacy FTP ON 26.X BE
Post by: meyergru on September 25, 2026, 10:53:04 PM
You only need that for active FTP, which I assumed why the question was asked. These days, most FTP servers can do passive FTP.