Hmmm... kod FPT protokola postoji 2 moda komunikacije... active i passive mod.
U active modu server salje PORT komandu a u passive salje PASV.
Code:
PORT
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.
Code:
PASV
Syntax: PASV
Tells the server to enter "passive mode". In passive mode, the server will wait for the client to establish a connection with it rather than attempting to connect to a client-specified port. The server will respond with the address of the port it is listening on, with a message like:
227 Entering Passive Mode (a1,a2,a3,a4,p1,p2)
where a1.a2.a3.a4 is the IP address and p1*256+p2 is the port number.
U active modu server ce pokusati da pozove klijenta pomocu parametara PORT komande. U passive modu, klijent nema javnu adresu pa ce server alocirati jedan port kod sebe za tog klijenta. Klijent treba da pokusa konekciju na adresu i port koja se nalazi u odgovoru na PASV komandu.
Ja sam server konfigurisao da radi na portovima 45000-45100 za passive konekcije. Router sam podesio da propusta te portove. Klijent se poveze, posalje PASV komandu, dobije odgovor i pokusa konekciju na adresu i port, i nista se ne desava. Ako ja u medjuvremenu sa klijent masine pokrenem telnet na PASV adresu i port, dobijem listing direktorijuma i prekid veze. Totalno sam zbunjen!!!