ProFTPd + NAT

mmgenius

Verified User
Joined
Jan 20, 2004
Messages
180
When you use NAT with ProFTPD you need to add MasqueradeAddress to the proftpd.conf file.

Is it possible to add this to the proftpd.conf file that custombuild makes? I think you can check the directadmin.conf lan_ip and ethernet_dev value if there is NAT used.
Here (at the bottom) you can find all the info: http://www.proftpd.org/docs/howto/NAT.html

You need to add this:
Code:
<IfModule mod_ifsession.c>
    # Define a class for internal clients
    <Class internal>
      From 10.0.0.0/8
    </Class>

    # Internal clients get a different MasqueradeAddress
    <IfClass internal>
      MasqueradeAddress 10.1.2.3
    </IfClass>

    # All other clients get some different, public MasqueradeAddress
    <IfClass !internal>
      MasqueradeAddress 1.2.3.4
    </IfClass>
  </IfModule>
 
Last edited:
Hello,

If you are looking for a way to integrate the code into ProFTPd config then update /etc/proftpd.conf per your needs and copy it to custombuild folder by running the following commands:

Code:
mkdir -p /usr/local/directadmin/custombuild/custom/proftpd/conf/
cd /usr/local/directadmin/custombuild/custom/proftpd/conf/
cp -p /etc/proftpd.conf .

If it is a feature request, then lets us know and the thread will be moved into appropriate subforum.
 
Alex see here my problem sorry to break in but here you write something different about the custom then in the howto guide directadmin.

Maybe that is causing some problem i and some others have with that proftpd.conf files. ;)

You write above :
mkdir -p /usr/local/directadmin/custombuild/custom/proftpd/conf/
cd /usr/local/directadmin/custombuild/custom/proftpd/conf/
cp -p /etc/proftpd.conf .

Her you see my problem after update proftpd with custombuild:

where manual > https://help.directadmin.com/item.php?id=439

So without /conf/ directory in custom.


?

And this location?
custom/proftpd/configure.proftpd
 
There is a simple rule find a file you want to modify under /usr/local/directadmin/custombuild/configure/ and repeating the structure of directories copy it to /usr/local/directadmin/custombuild/custom/

Original configs for ProFTPd are located under /usr/local/directadmin/custombuild/configure/proftpd/conf/ so custom files should be placed under /usr/local/directadmin/custombuild/custom/proftpd/conf/.
 
Alex thanks .
Then Directadmin https://help.directadmin.com/item.php?id=439 howto is wrong here! :cry:
Recompile proftpd with the required changes:
cd /usr/local/directadmin/custombuild
./build update
./build set ftpd proftpd
mkdir -p custom/proftpd
wget -O custom/proftpd/configure.proftpd http://files.directadmin.com/services/all/sftp/configure.proftpd.sftp
wget -O custom/proftpd/proftpd.conf http://files.directadmin.com/services/all/sftp/proftpd.conf here wrong they forgot the / conf/ ?
chmod 755 custom/proftpd/configure.proftpd
wget -O /etc/proftpd.sftp.conf http://files.directadmin.com/services/all/sftp/proftpd.sftp.conf
./build proftpd
 
Hello Alex,

I know that you can make a custom proftpd.conf file, but then the whole file is custom. So if DA or CustomBuild change something to there proftpd.conf file it will not be changed in the custom proftpd.conf file (and we will not be notified that it need to be changed).

This is why I think it is beter that custombuild take care of it.
 
OK, I see. That's up to DirectAdmin developers then. So let's see how many of users here want the same. Probably the developers will add it into one of the next releases.
 
Small update:

1) forgot to say that mod_ifsession is not compiled by default, so configure.proftpd need to add it (http://www.proftpd.org/docs/contrib/mod_ifsession.html#Installation)

2) In the class section we needed to add the router-address (standard-gateway address), because else he always think it is from internal addresses:
Code:
<Class internal>
    From 10.0.0.0/8
    From !10.0.0.254
    Satisfy all
</Class>
 
Back
Top