setup reverse ftp-proxy on OpenBSD
Saturday, August 14, 2010 7:14:51 AM
The ftp-proxy daemon of OpenBSD is a built-in service which can be easily configured to forward FTP connections in /etc/rc.conf.local, /etc/pf.conf, and /etc/sysctl.conf. This daemon listened on port 8021 by default, which can be changed.
1) You can fireup multiple ftp-proxy daemons by CLI:
# /usr/sbin/ftp-proxy -p 8021 -R my.ftp.server -P 21 -D7 -v
add the following line to /etc/rc.conf.local to start at boot:
ftpproxy_flags="-p 8021 -R my.ftp.server -P 21 -D7 -v"
2) Remove the comments of ftp-proxy in /etc/pf.conf:
anchor "ftp-proxy/*"
pass in quick proto tcp to port 21 rdr-to 127.0.0.1 port 8021
# pfctl -f /etc/pf.conf
3) Enable packet forwarding between interfaces.
# sysctl net.inet.ip.forwarding=1
and remove the comment of net.inet.ip.forwarding=1 in /etc/sysctl.conf to enable it at boot.
4) Congratulations! You can connect to my.ftp.server via ftp-proxy as followis:
# ftp my.proxy.server
REFERENCES:
https://calomel.org/ftp_proxy.html
1) You can fireup multiple ftp-proxy daemons by CLI:
# /usr/sbin/ftp-proxy -p 8021 -R my.ftp.server -P 21 -D7 -v
add the following line to /etc/rc.conf.local to start at boot:
ftpproxy_flags="-p 8021 -R my.ftp.server -P 21 -D7 -v"
2) Remove the comments of ftp-proxy in /etc/pf.conf:
anchor "ftp-proxy/*"
pass in quick proto tcp to port 21 rdr-to 127.0.0.1 port 8021
# pfctl -f /etc/pf.conf
3) Enable packet forwarding between interfaces.
# sysctl net.inet.ip.forwarding=1
and remove the comment of net.inet.ip.forwarding=1 in /etc/sysctl.conf to enable it at boot.
4) Congratulations! You can connect to my.ftp.server via ftp-proxy as followis:
# ftp my.proxy.server
REFERENCES:
https://calomel.org/ftp_proxy.html






