Re: [pure-ftpd] Issues with GCP load balancing multi instance

Boris Astardzhiev <[email protected]> Thu, 27 Feb 2020 18:36:23 +0200
Newsgroups gmane.network.pureftpd.user
Message-ID <CAP=KkTwy3upT_vQ1jzw82gmpJLPSozVZ_yd20NWH4E4Y=F1iOw@mail.gmail.com>
--000000000000f36a00059f9152ba
Content-Type: text/plain; charset="UTF-8"

Luca, join here and share your view and we might have this feature to
mainline through the right way considered by the maintainer:
https://github.com/jedisct1/pure-ftpd/pull/146

On Thu, Feb 27, 2020 at 6:29 PM Boris Astardzhiev <
[email protected]> wrote:

> Hi,
>
> We might try to ask maintainer if it's okay and export such an option. I
> doubt it will be that hard to add another option.
>
> Regards
>
> On Thu, Feb 27, 2020 at 6:23 PM Luca Gervasi <[email protected]>
> wrote:
>
>> Hi,
>> thanks! I think it would solve the problem tho i'm not allowed to put self
>> compiled code on production, so this is pretty useless to me :(
>>
>> What about a specific switch that allows to either (a) bind to any
>> (0.0.0.0) or (b) force bind to passiveip ip (so that it doesn't break
>> previous code) ?
>>
>> Thanks
>> Luca
>>
>> On Thu, Feb 27, 2020 at 5:13 PM Boris Astardzhiev <
>> [email protected]> wrote:
>>
>> > Hello,
>> >
>> > Try this. Though it was rejected by maintainer it might help in you
>> case.
>> >
>> >
>> https://github.com/jedisct1/pure-ftpd/pull/146/commits/a3405795856be3f34b8dad2cda0a90c82451a5cf
>> > Let me know if it helps.
>> >
>> > Regards,
>> > Boris
>> >
>> > On Thu, Feb 27, 2020 at 6:03 PM Luca Gervasi <[email protected]>
>> > wrote:
>> >
>> > > Hi,
>> > > i'm trying to configure pure-ftpd behind a load balancer on GCP. In my
>> > > setup, i want to configure load balancing on port 21, having 2
>> instances
>> > > with its own public ip to be used for passive ports.
>> > > So: you connect to a common address <mylb.organisation>:21, it
>> > > redistributes to the working instances, each of them then PASV to its
>> own
>> > > ip and the ephemeral port configured. This is the configuration
>> example:
>> > > On instance1:
>> > > PassivePortRange          60000 61000
>> > > ForcePassiveIP            <instance1IP>
>> > >
>> > > On instance2:
>> > > PassivePortRange          60000 61000
>> > > ForcePassiveIP            <instance1IP>
>> > >
>> > > And so far this works:
>> > > Status: Logged in
>> > > Status: Retrieving directory listing...
>> > > Command: PWD
>> > > Response: 257 "/" is your current location
>> > > Command: TYPE I
>> > > Response: 200 TYPE is now 8-bit binary
>> > > Command: PASV
>> > > Response: 227 Entering Passive Mode (InstanceIP1,234,246)
>> > >
>> > > Problem is that when it goes bind(), it uses the (and how the hell
>> did it
>> > > get the ip?) load balancer ip:
>> > > 2251 bind(9, {sa_family=AF_INET, sin_port=htons(60553),
>> > > sin_addr=inet_addr("<LOADBALANCERIP>")}, 16) = 0
>> > > 12251 alarm(120)                        = 240
>> > > 12251 listen(9, 8                     = 0
>> > > 12251 sendto(3, "<95>Feb 27 14:44:05 pure-ftpd[12251]:
>> ([email protected]
>> > )
>> > > [DEBUG] 227 Entering Passive Mode (<InstanceIP>,236,137)", 119,
>> > > MSG_NOSIGNAL, NULL, 0) = 119
>> > > 12251 write(6, "227 Entering Passive Mode (<InstanceIP>,236,137)\r\n",
>> > 50)
>> > > = 50
>> > >
>> > > So when the client tries to connect to the server, it gets a RST after
>> > the
>> > > syn, even if the port is actually listening correctly.
>> > >
>> > > Is there a way to have pure-ftpd binding to 0.0.0.0 or its own ip
>> during
>> > > the passive binding?
>> > >
>> > > Thanks!
>> > >
>> > > Luca
>> > >
>> >
>>
>

--000000000000f36a00059f9152ba--