Re: [Proftpd-user] NAT issue with virtualHost

Philippe Mackowiak via Proftp-user <[email protected]> Thu, 7 Nov 2024 09:58:50 +0000
Newsgroups gmane.network.proftpd.user
Message-ID <MR1P264MB1731824574BC2BDDC9024A0CB45C2@MR1P264MB1731.FRAP264.PROD.OUTLOOK.COM>
--===============4306799549817036938==
Content-Language: fr-FR
Content-Type: multipart/alternative;
	boundary="_000_MR1P264MB1731824574BC2BDDC9024A0CB45C2MR1P264MB1731FRAP_"

--_000_MR1P264MB1731824574BC2BDDC9024A0CB45C2MR1P264MB1731FRAP_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Thank you for your answer.

Following your remarks, I ended up have the following config working for a =
VirtualHost over inbound NAT device.

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Port 0
DefaultServer                   off

<VirtualHost <private_ip>>
            Port                    21
PassivePorts                    60000 65535
MasqueradeAddress       <public_ip>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Well, in the end, that was an easy one, thanks for the tip.

Regards.
PM.


-----Message d'origine-----
De : TJ Saunders <[email protected]>
Envoy=E9 : mercredi 6 novembre 2024 22:23
=C0 : ProFTPD Users <[email protected]>
Cc : Philippe Mackowiak <[email protected]>
Objet : Re: [Proftpd-user] NAT issue with virtualHost


> This config works (without VirtualHost): No issue.

Can you clarify what "works" means, specifically?  That is, are TCP connect=
ions not accepted?  Is authentication failing?  Does authentication succeed=
, but data transfers (including directory listings) stall/fail?

The ways in which things fail, or don't work as expected, can help indicate=
 the causes/factors involved.

> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
> DefaultAddress                  <private_ip>
> Port                            21
> DefaultServer                   off
> MasqueradeAddress       <public_ip>
> PassivePorts                    60000 65535
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
>
> This one does not work (commands hanging over passive ftp connection):
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
> Port 0
> DefaultServer                   off
> PassivePorts                    60000 65535
>
> <VirtualHost <private_ip>>
>         Port                    21
>         MasqueradeAddress       <public_ip>

My initial guess is that, in this second case, the PassivePorts directive i=
s not in effect for the <VirtualHost>.

Directives outside of any <Global> (or <VirtualHost>) section are not autom=
atically globally applied; see:

  http://www.proftpd.org/docs/howto/Vhost.html

> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
> This one does not work either: warning: "Virtual Server" address/port
> (xxxxx) already in use by "ProFTP server"
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
> Port 21
> DefaultServer                   off
> PassivePorts                    60000 65535
>
> <VirtualHost <private_ip>>
>         MasqueradeAddress       <public_ip>

In this particular case, the warning is saying that your <VirtualHost> sect=
ion is using Port 21 (the default value) by default -- and that it is colli=
ding with the "server config" (default vhost), which is also using Port 21.

Hope this helps,
TJ

--_000_MR1P264MB1731824574BC2BDDC9024A0CB45C2MR1P264MB1731FRAP_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
span.EmailStyle19
	{mso-style-type:personal-compose;
	font-family:"Times New Roman",serif;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;
	mso-ligatures:none;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"FR" link=3D"blue" vlink=3D"purple" style=3D"word-wrap:break-w=
ord">
<div class=3D"WordSection1">
<div>
<p class=3D"MsoNormal"><span lang=3D"EN-GB"><br>
Thank you for your answer.<br>
<br>
Following your remarks, I ended up have the following config working for a =
VirtualHost over inbound NAT device.<br>
<br>
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB" style=3D"font-size:10.0pt;font-=
family:&quot;Arial&quot;,sans-serif">=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB" style=3D"font-size:10.0pt;font-=
family:&quot;Arial&quot;,sans-serif">Port 0<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB" style=3D"font-size:10.0pt;font-=
family:&quot;Arial&quot;,sans-serif">DefaultServer&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp; off<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB" style=3D"font-size:10.0pt;font-=
family:&quot;Arial&quot;,sans-serif"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB" style=3D"font-size:10.0pt;font-=
family:&quot;Arial&quot;,sans-serif">&lt;VirtualHost &lt;private_ip&gt;&gt;=
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB" style=3D"font-size:10.0pt;font-=
family:&quot;Arial&quot;,sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><span style=3D"font-size:10.0pt;font-family:&quot;Arial&quot;,sans-s=
erif">Port&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 21<o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"text-indent:35.4pt"><span lang=3D"EN-GB" st=
yle=3D"font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">PassivePo=
rts&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 60000 65535<o:p></o:p></span></p=
>
<p class=3D"MsoNormal" style=3D"text-indent:35.4pt"><span lang=3D"EN-GB" st=
yle=3D"font-size:10.0pt;font-family:&quot;Arial&quot;,sans-serif">Masquerad=
eAddress&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;public_ip&gt;<o:p></o:p></=
span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB" style=3D"font-size:10.0pt;font-=
family:&quot;Arial&quot;,sans-serif">=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">Well, in the end, that was an e=
asy one, thanks for the tip.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">Regards.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB">PM.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-GB"><br>
<br>
-----Message d'origine-----<br>
De&nbsp;: TJ Saunders &lt;[email protected]&gt; <br>
Envoy=E9&nbsp;: mercredi 6 novembre 2024 22:23<br>
=C0&nbsp;: ProFTPD Users &lt;[email protected]&gt;<br>
Cc&nbsp;: Philippe Mackowiak &lt;[email protected]&gt;<br>
Objet&nbsp;: Re: [Proftpd-user] NAT issue with virtualHost<br>
<br>
<br>
&gt; This config works (without VirtualHost): No issue.<br>
<br>
Can you clarify what &quot;works&quot; means, specifically?&nbsp; That is, =
are TCP connections not accepted?&nbsp; Is authentication failing?&nbsp; Do=
es authentication succeed, but data transfers (including directory listings=
) stall/fail?<br>
<br>
The ways in which things fail, or don't work as expected, can help indicate=
 the causes/factors involved.<br>
<br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D<br>
&gt; DefaultAddress&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;private_ip&gt;<br>
&gt; Port&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp; 21<br>
&gt; DefaultServer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; off<br>
&gt; MasqueradeAddress&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;public_ip&gt=
;<br>
&gt; PassivePorts&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 60000 65535<br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D<br>
&gt; <br>
&gt; This one does not work (commands hanging over passive ftp connection):=
<br>
&gt; <br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D<br>
&gt; Port 0<br>
&gt; DefaultServer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; off<br>
&gt; PassivePorts&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 60000 65535<br>
&gt; <br>
&gt; &lt;VirtualHost &lt;private_ip&gt;&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Port&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp; 21<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MasqueradeAddress&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;public_ip&gt;<br>
<br>
My initial guess is that, in this second case, the PassivePorts directive i=
s not in effect for the &lt;VirtualHost&gt;.<br>
<br>
Directives outside of any &lt;Global&gt; (or &lt;VirtualHost&gt;) section a=
re not automatically globally applied; see:<br>
<br>
&nbsp; </span><a href=3D"http://www.proftpd.org/docs/howto/Vhost.html" targ=
et=3D"_BLANK"><span lang=3D"EN-GB">http://www.proftpd.org/docs/howto/Vhost.=
html</span></a><span lang=3D"EN-GB"><br>
<br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D<br>
&gt; This one does not work either: warning: &quot;Virtual Server&quot; add=
ress/port <br>
&gt; (xxxxx) already in use by &quot;ProFTP server&quot;<br>
&gt; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D<br>
&gt; Port 21<br>
&gt; DefaultServer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; off<br>
&gt; PassivePorts&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 60000 65535<br>
&gt; <br>
&gt; &lt;VirtualHost &lt;private_ip&gt;&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MasqueradeAddress&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;public_ip&gt;<br>
<br>
In this particular case, the warning is saying that your &lt;VirtualHost&gt=
; section is using Port 21 (the default value) by default -- and that it is=
 colliding with the &quot;server config&quot; (default vhost), which is als=
o using Port 21.<br>
<br>
</span>Hope this helps,<br>
TJ<o:p></o:p></p>
</div>
</div>
</body>
</html>

--_000_MR1P264MB1731824574BC2BDDC9024A0CB45C2MR1P264MB1731FRAP_--


--===============4306799549817036938==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============4306799549817036938==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ProFTPD Users List   <[email protected]>
Unsubscribe problems?
http://www.proftpd.org/list-unsub.html
--===============4306799549817036938==--