access from lan ip via public ip

Need help with FileZilla Server? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Message
Author
muznark
500 Syntax error
Posts: 14
Joined: 2009-02-19 18:26
First name: andrey
Last name: druginin

access from lan ip via public ip

#1 Post by muznark » 2023-11-27 07:06

hello all! I am connected to the internet via a router with a public ip on the wan port.
how to make the server return the public ip when connecting from a private address from the provider's side, and return private ip when connecting frome my home network(192.168.3.1-254) in PASV relpy ?

muznark
500 Syntax error
Posts: 14
Joined: 2009-02-19 18:26
First name: andrey
Last name: druginin

Server feature request: passive mode setting, Use the default host from my lan only

#2 Post by muznark » 2023-11-27 08:39

hello all, to fix this situation without install two servers
Server feature request: passive mode setting, Use the default host from my lan only.

User avatar
oibaf
Contributor
Posts: 416
Joined: 2021-07-16 21:02
First name: Fabio
Last name: Alemagna

Re: access from lan ip via public ip

#3 Post by oibaf » 2023-11-27 16:19

You must simply activate the check on "Use the default host for local connections" in the Passive mode configuration page.
Schermata del 2023-11-27 17-18-22.png
Schermata del 2023-11-27 17-18-22.png (48.25 KiB) Viewed 6782 times

User avatar
botg
Site Admin
Posts: 35596
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Server feature request: passive mode setting, Use the default host from my lan only

#4 Post by botg » 2023-11-27 17:16

Why? That couldn't possibly work.

muznark
500 Syntax error
Posts: 14
Joined: 2009-02-19 18:26
First name: andrey
Last name: druginin

Re: access from lan ip via public ip

#5 Post by muznark » 2023-11-27 18:01

if client from provider lan use private ip - server report my private ip for this client...

muznark
500 Syntax error
Posts: 14
Joined: 2009-02-19 18:26
First name: andrey
Last name: druginin

Re: Server feature request: passive mode setting, Use the default host from my lan only

#6 Post by muznark » 2023-11-27 18:19

if a client with a private ip connects from the provider side, and the use default host for local connection option is marked in the server, will your server return the public ip registered in it, or my private ip ?

User avatar
oibaf
Contributor
Posts: 416
Joined: 2021-07-16 21:02
First name: Fabio
Last name: Alemagna

Re: access from lan ip via public ip

#7 Post by oibaf » 2023-11-27 18:25

You mean that other clients are connecting to the server from IPs in the 172.16.0.0/12 or 10.0.0.0/8 ranges and to those you want the give the server's public IP when they issue the PASV command?

If that is so, it's not currently possible.

User avatar
botg
Site Admin
Posts: 35596
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Server feature request: passive mode setting, Use the default host from my lan only

#8 Post by botg » 2023-11-27 18:35

Clients connecting to the server's public IP address over the internet are always seen as coming from a public IP address. You cannot present such clients your private LAN IP address, as they are not within your local network, and private address ranges are not being routed over the internet.

muznark
500 Syntax error
Posts: 14
Joined: 2009-02-19 18:26
First name: andrey
Last name: druginin

Re: Server feature request: passive mode setting, Use the default host from my lan only

#9 Post by muznark » 2023-11-27 18:35

a small correction is needed to the "use default host for local connection" option, but what should I do with a local connection? all private ip, or selected ip range...?

muznark
500 Syntax error
Posts: 14
Joined: 2009-02-19 18:26
First name: andrey
Last name: druginin

Re: Server feature request: passive mode setting, Use the default host from my lan only

#10 Post by muznark » 2023-11-27 18:40

I understand that the problem is far-fetched (modern software will bypass it), but purely theoretically...

User avatar
botg
Site Admin
Posts: 35596
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Server feature request: passive mode setting, Use the default host from my lan only

#11 Post by botg » 2023-11-27 18:44

Private is private, public is public. There is no distinction between different addresses or address ranges within the same address type.

127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 and 169.254.0.0/16 are private address ranges. If "Use default host for local connection" is set, FileZilla Server automatically replies to the PASV command with the same IP address used by the FTP control connection. That is guaranteed to work, as the control connection was already being able to be established that same way.

It is only clients connecting from the Internet, and thus a public IP address, which need to be informed about the server's public IP address in the PASV reply. As this information is not available in the presence of NAT, this information has to be provided in the server configuration.

muznark
500 Syntax error
Posts: 14
Joined: 2009-02-19 18:26
First name: andrey
Last name: druginin

Re: Server feature request: passive mode setting, Use the default host from my lan only

#12 Post by muznark » 2023-11-27 19:13

for me, everything behind the wan port is the Internet, and for the server there is a concept of private ip, and I would like all clients behind the wan port to receive a public ip in response to pasv, and my devices on the home network are the private address of the server

muznark
500 Syntax error
Posts: 14
Joined: 2009-02-19 18:26
First name: andrey
Last name: druginin

Re: Server feature request: passive mode setting, Use the default host from my lan only

#13 Post by muznark » 2023-11-27 19:27

option : to shield only my subnet with local connections will not hurt anyone, and will help many, imho

User avatar
boco
Contributor
Posts: 26956
Joined: 2006-05-01 03:28
Location: Germany

Re: Server feature request: passive mode setting, Use the default host from my lan only

#14 Post by boco » 2023-11-27 23:05

Clients coming from the public net don't have a private IP. Private IPs are invalid on the Internet, as they are not unique and thus not routed.

Note that in case of double-NAT (CGN, Carrier Grade NAT), running servers is impossible.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

User avatar
botg
Site Admin
Posts: 35596
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Server feature request: passive mode setting, Use the default host from my lan only

#15 Post by botg » 2023-11-27 23:11

option : to shield only my subnet with local connections
"To shield"? Please repeat after me: A NAT is not a firewall. Write that a hundred times.
Note that in case of double-NAT (CGN, Carrier Grade NAT), running servers is impossible.
Double-nat, aka NAT-in-NAT, is an abomination, it must not ever be used. At least thanks to IPv6, these days there's zero reason to ever use NAT. Use IPv6 if you can, it is your friend.

Post Reply