Sending the ftp "PORT" command

Hi all, can anyone please tell me how to make a simple script that sends the PORT 30000 command to an ftp server every second?
I cant seem to find a way to change the port from 200.

I don’t think ftp ever use port 200, and what are you exactly trying to do?

I need this so that my external nat ip (wich I can’t control) will open that port, allowing me to host webpages outside of the private network.
I am doing it on a friend’s ftp server of course.

ok, this doesn’t look like a QNX question, but I will try to answer it :slight_smile:

you need to send a ftp raw command PORT, here is the syntax:
PORT a1,a2,a3,a4,p1,p2
Specifies the host and port to which the server should connect for the next file transfer. This is interpreted as IP address a1.a2.a3.a4, port p1*256+p2.

this will trick your NAT firewall to open up the port (assuming the firewall supports the active ftp), allow the incoming connection to the port and forward it to your internal QNX host …

Your idea is good, but I am sure any reasonably good NAT firewall will ONLY open that port to the ftp server IP only. This means you can’t expect arbitraty IPs on the Internet to pass through that port to your internal host. Your idea will work if either your firewall is not very good, or you only want to allow the connect from the ftp server IP address.

Now to answer your question: I am not sure if QNX’s ftp can send RAW command. But you can write your own php script that talks ftp protocol and sends the PORT command.
devarticles.com/c/a/PHP/Buil … -With-PHP/