Skip to content

Commit 7137ad6

Browse files
authored
Port forwarding for an FTP server in passive mode (#292)
* Document FTP server port forwarding configuration Added instructions for configuring port forwarding for FTP servers in passive mode, including enabling FTP helper modules and settings for the WAN zone. * Refine port forwarding documentation for clarity Rephrase and improve clarity of port forwarding documentation, specifically for FTP and Hairpin NAT sections. * Update port forwards migration details Added note about enabling FTP conntrack helper for port forwarding. * italian translation added Added instructions for configuring FTP passive mode port forwarding and hairpin NAT. * Update port forward migration details in IT Added note about enabling FTP conntrack helper for port forwarding.
1 parent 11a0045 commit 7137ad6

4 files changed

Lines changed: 76 additions & 2 deletions

File tree

docs/administrator-manual/firewall/port_forward.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,42 @@ For each port forward the user can also configure the following aspects:
3131
- **Access restriction**: Port forwards can be restricted to specific sources to enhance security. This can be done using the `Restrict access to` field. The field accepts IP addresses, CIDR blocks or an object. All objects are supported, except host sets containing IP ranges or nested objects.
3232
- **Enabling logging**: port forwards can be configured to log incoming traffic for each rule. By enabling the `Log` option, the network administrator can keep track of the traffic passing through the port forward, allowing for monitoring and analysis. By default, logging is limited to 1 entry per second. To change this limit, refer to the [Logging limits](./firewall_rules.md#logging-limits) section.
3333

34+
## Port forwarding for an FTP server in passive mode {#port_forward_ftp-section}
35+
36+
When creating a port forward for TCP port `21` to publish an FTP server located inside the LAN, passive FTP connections may not work correctly with the default configuration.
37+
Passive FTP uses additional dynamically negotiated ports for data connections: to allow NethSecurity 8 to identify these related connections and apply NAT correctly, the Netfilter FTP connection tracking helper must be enabled on the WAN zone.
38+
39+
### Configuration
40+
41+
#### 1. Load the FTP helper modules
42+
43+
From the **NAT helpers** page in the web interface, enable the following kernel modules:
44+
45+
```text
46+
nf_conntrack_ftp
47+
nf_nat_ftp
48+
```
49+
50+
#### 2. Enable the FTP helper on the WAN zone
51+
52+
Connect to the firewall through SSH and run:
53+
54+
```bash
55+
uci set firewall.ns_wan.auto_helper='0'
56+
uci set firewall.ns_wan.helper='ftp'
57+
uci commit firewall
58+
reload_config
59+
```
60+
61+
This configuration disables automatic helper assignment and explicitly enables the FTP helper on the `ns_wan` zone.
62+
63+
:::warning
64+
65+
If the firewall was migrated from NethServer 7, step 1 is not required because the FTP helper modules are already enabled by default for backward compatibility.
66+
However, step 2 is still required: the FTP helper must be explicitly assigned to the `ns_wan` zone also on migrated systems.
67+
68+
:::
69+
3470
## Hairpin NAT {#hairpin-section}
3571

3672
Hairpin NAT, also known as NAT loopback or NAT reflection, is a technique used in networking where internal hosts access a server located within the same local network using the external IP address of the router or firewall. In other words, when internal devices attempt to connect to a server using the public IP address, hairpin NAT ensures that the traffic is routed internally without going out to the internet and then back into the local network.

docs/administrator-manual/migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ After the changes, devices use shorter names (e.g., `b0`, `b0.20`), compatible w
140140
| DHCP servers and reservations | Migrated with limits | DHCP servers on bond interfaces are not supported. |
141141
| DNS configuration and local hosts | Migrated with limits | TFTP options are migrated, but TFTP content is not. Configure `tftp_root` manually to re-enable it. |
142142
| Static IPv4 routes | Migrated | |
143-
| Port forwards | Migrated | |
143+
| Port forwards | Migrated | If you use port forwarding for an FTP server, you must explicitly enable the FTP conntrack helper on the WAN zone. See [Port Forward](./firewall/port_forward.md) for details. |
144144
| Firewall zones | Migrated | Green → `lan`, red → `wan`, orange → `dmz`, blue → `guest`. If a blue zone existed, DNS and DHCP accept rules are added automatically. |
145145
| Firewall rules | Migrated with conversion | Rules using NDPI services are not supported. Source/destination objects are converted to IP/CIDR values. NAT helpers are loaded automatically. |
146146
| Firewall objects | Not recreated | Objects cannot be reimported automatically. Rules that used objects are converted to the corresponding IP/CIDR values. |

i18n/it/docusaurus-plugin-content-docs/current/administrator-manual/firewall/port_forward.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,44 @@ Per ogni port forward l'utente può anche configurare i seguenti aspetti:
3131
- **Restrizione dell'accesso**: i port forward possono essere limitati a fonti specifiche per migliorare la sicurezza. Questo può essere fatto utilizzando il campo `Restrict access to`. Il campo accetta indirizzi IP, blocchi CIDR o un oggetto. Tutti gli oggetti sono supportati, ad eccezione dei set di host contenenti intervalli di IP o oggetti annidati.
3232
- **Abilitazione della registrazione**: i port forward possono essere configurati per registrare il traffico in ingresso per ogni regola. Abilitando l'opzione `Log`, l'amministratore di rete può tenere traccia del traffico che passa attraverso il port forward, consentendo il monitoraggio e l'analisi. Per impostazione predefinita, la registrazione è limitata a 1 voce al secondo. Per modificare questo limite, fare riferimento alla sezione [Logging limits](./firewall_rules.md#logging-limits).
3333

34+
## Port forwarding per un server FTP in modalità passiva {#port_forward_ftp-section}
35+
36+
Quando si crea un port forward della porta TCP `21` per pubblicare un server FTP situato nella LAN, le connessioni FTP passive potrebbero non funzionare correttamente con la configurazione predefinita.
37+
38+
L'FTP passivo utilizza porte aggiuntive negoziate dinamicamente per le connessioni dati. Per consentire a NethSecurity 8 di identificare queste connessioni correlate e applicare correttamente il NAT, è necessario abilitare l'helper di connection tracking FTP di Netfilter sulla zona WAN.
39+
40+
### Configurazione
41+
42+
#### 1. Caricare i moduli helper FTP
43+
44+
Dalla pagina **NAT helpers** dell'interfaccia web, abilitare i seguenti moduli del kernel:
45+
46+
```text
47+
nf_conntrack_ftp
48+
nf_nat_ftp
49+
```
50+
51+
#### 2. Abilitare l'helper FTP sulla zona WAN
52+
53+
Connettersi al firewall tramite SSH ed eseguire:
54+
55+
```bash
56+
uci set firewall.ns_wan.auto_helper='0'
57+
uci set firewall.ns_wan.helper='ftp'
58+
uci commit firewall
59+
reload_config
60+
```
61+
62+
Questa configurazione disabilita l'assegnazione automatica degli helper e abilita esplicitamente l'helper FTP sulla zona `ns_wan`.
63+
64+
:::warning
65+
66+
Se il firewall è stato migrato da NethServer 7, il passaggio 1 non è necessario perché, per compatibilità con le versioni precedenti, i moduli helper FTP sono già abilitati per impostazione predefinita.
67+
Il passaggio 2 rimane comunque necessario: anche sui sistemi migrati, l'helper FTP deve essere assegnato esplicitamente alla zona `ns_wan`.
68+
69+
:::
70+
71+
3472
## Hairpin NAT {#hairpin-section}
3573

3674
Hairpin NAT, noto anche come NAT loopback o NAT reflection, è una tecnica utilizzata in rete in cui gli host interni accedono a un server situato all'interno della stessa rete locale utilizzando l'indirizzo IP esterno del router o del firewall. In altre parole, quando i dispositivi interni tentano di connettersi a un server utilizzando l'indirizzo IP pubblico, hairpin NAT garantisce che il traffico sia instradato internamente senza uscire da internet e poi rientrare nella rete locale.

i18n/it/docusaurus-plugin-content-docs/current/administrator-manual/migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Dopo le modifiche, i dispositivi usano nomi più corti (es. `b0`, `b0.20`), comp
140140
| Server DHCP e prenotazioni | Migrata con limitazioni | I server DHCP su interfacce bond non sono supportati. |
141141
| Configurazione DNS e host locali | Migrata con limitazioni | Le opzioni TFTP sono migrate, ma il contenuto TFTP no. Per riabilitarlo, configura `tftp_root` manualmente. |
142142
| Rotte IPv4 statiche | Migrata | |
143-
| Port forward | Migrata | |
143+
| Port forward | Migrata | Se utilizzi il port forwarding per un server FTP, devi abilitare esplicitamente l’helper conntrack FTP sulla zona WAN. Consulta la sezione [Port Forward](./firewall/port_forward.md) per i dettagli.|
144144
| Zone firewall | Migrata | Green → `lan`, red → `wan`, orange → `dmz`, blue → `guest`. Se esisteva una zona blue, le regole di accettazione DNS e DHCP vengono aggiunte automaticamente. |
145145
| Regole firewall | Migrata con conversione | Le regole che usano servizi NDPI non sono supportate. Gli oggetti sorgente/destinazione vengono convertiti in valori IP/CIDR. |
146146
| Oggetti firewall | Non ricreati | Gli oggetti non possono essere reimportati automaticamente. Le regole che usavano oggetti vengono convertite nei corrispondenti valori IP/CIDR. |

0 commit comments

Comments
 (0)