I want to setup MikroTik on a client side. Client behind the MikroTik must be able to use FTP over TLS in active mode (TCP:21).
Encrypted passive mode works fine, as well as plain passive and plain active modes.
From what I understand, MiktoTik FTP helper (Firewall - Service Ports - ftp), can't read what's inside the packets due to encryption used, and cannot make connections based on info from PORT/PASV commands. So, FTP client can initialize TLS connection and start talking to FTP server, but fails on directory list command (timeout).
And here is a log from FTP server (the same connection as above; just opposive side of view):
02:54:30, 76, SRV.IP.ADDR.ES, , AUTH TLS
02:54:30, 76, SRV.IP.ADDR.ES, , 234 AUTH command ok; starting SSL connection.
02:54:30, 76, SRV.IP.ADDR.ES, , establishing encrypted session
02:54:30, 76, SRV.IP.ADDR.ES, , USER client-username
02:54:30, 76, SRV.IP.ADDR.ES, client-username, 331 Password required for client-username.
02:54:30, 76, SRV.IP.ADDR.ES, client-username, PASS ****
02:54:30, 76, SRV.IP.ADDR.ES, client-username, logged in as "client-username".
02:54:30, 76, SRV.IP.ADDR.ES, client-username, 230 User client-username logged
02:54:31, 76, SRV.IP.ADDR.ES, client-username, FEAT
02:54:31, 76, SRV.IP.ADDR.ES, client-username, 211-Extensions supported:
02:54:31, 76, SRV.IP.ADDR.ES, client-username, AUTH TLS
02:54:31, 76, SRV.IP.ADDR.ES, client-username, CCC
02:54:31, 76, SRV.IP.ADDR.ES, client-username, CLNT
02:54:31, 76, SRV.IP.ADDR.ES, client-username, CPSV
02:54:31, 76, SRV.IP.ADDR.ES, client-username, EPRT
02:54:31, 76, SRV.IP.ADDR.ES, client-username, EPSV
02:54:31, 76, SRV.IP.ADDR.ES, client-username, MDTM
02:54:31, 76, SRV.IP.ADDR.ES, client-username, MFCT
02:54:31, 76, SRV.IP.ADDR.ES, client-username, MFMT
02:54:31, 76, SRV.IP.ADDR.ES, client-username, MLST type*;size*;create;modify*;
02:54:31, 76, SRV.IP.ADDR.ES, client-username, MODE Z
02:54:31, 76, SRV.IP.ADDR.ES, client-username, PASV
02:54:31, 76, SRV.IP.ADDR.ES, client-username, PBSZ
02:54:31, 76, SRV.IP.ADDR.ES, client-username, PROT
02:54:31, 76, SRV.IP.ADDR.ES, client-username, REST STREAM
02:54:31, 76, SRV.IP.ADDR.ES, client-username, SBUF
02:54:31, 76, SRV.IP.ADDR.ES, client-username, SIZE
02:54:31, 76, SRV.IP.ADDR.ES, client-username, SSCN
02:54:31, 76, SRV.IP.ADDR.ES, client-username, TVFS
02:54:31, 76, SRV.IP.ADDR.ES, client-username, UTF8
02:54:31, 76, SRV.IP.ADDR.ES, client-username, XCRC "filename" SP EP
02:54:31, 76, SRV.IP.ADDR.ES, client-username, XMD5 "filename" SP EP
02:54:31, 76, SRV.IP.ADDR.ES, client-username, XSHA1 "filename" SP EP
02:54:31, 76, SRV.IP.ADDR.ES, client-username, 211 End.
02:54:31, 76, SRV.IP.ADDR.ES, client-username, PBSZ 0
02:54:31, 76, SRV.IP.ADDR.ES, client-username, 200 PBSZ=0
02:54:31, 76, SRV.IP.ADDR.ES, client-username, PROT P
02:54:31, 76, SRV.IP.ADDR.ES, client-username, 200 PROT command successful.
02:54:31, 76, SRV.IP.ADDR.ES, client-username, OPTS UTF8 ON
02:54:31, 76, SRV.IP.ADDR.ES, client-username, 200 UTF8 OPTS ON
02:54:31, 76, SRV.IP.ADDR.ES, client-username, CWD /
02:54:31, 76, SRV.IP.ADDR.ES, client-username, change directory "/" --> Access allowed.
02:54:31, 76, SRV.IP.ADDR.ES, client-username, 250 CWD command successful. "/" is current directory.
02:54:31, 76, SRV.IP.ADDR.ES, client-username, TYPE A
02:54:31, 76, SRV.IP.ADDR.ES, client-username, 200 Type set to A.
02:54:31, 76, SRV.IP.ADDR.ES, client-username, MODE Z
02:54:31, 76, SRV.IP.ADDR.ES, client-username, 200 Mode Z ok.
02:54:32, 76, SRV.IP.ADDR.ES, client-username, PORT 10,0,0,43,202,73
02:54:32, 76, SRV.IP.ADDR.ES, client-username, 200 Port command successful.
02:54:32, 76, SRV.IP.ADDR.ES, client-username, MLSD
02:54:53, 76, SRV.IP.ADDR.ES, client-username, 425 Cannot open data connection.
02:54:53, 76, SRV.IP.ADDR.ES, client-username, PASV
02:54:53, 76, SRV.IP.ADDR.ES, client-username, 227 Entering Passive Mode (SRV,IP,ADDR,ES,31,114)
Firewall settings are very basic now, just allowed related and established connections (both IN and FW chains). There are no any drops temporary. And two defconf rules, passthrough and fasttrack. That's all.
Please help me create a rule for firewall that will allow this kind of conneciton.