I would like to know if there is any capability to insert packets in an existing connection, e.g. in a script.
Use case: I have a device that cannot be changed, connected to a MikroTik router that maintains a VPN to another MikroTik router,
which forwards the traffic from that device towards a stateful firewall that is hard to change (consider it like a NAT router).
The device opens a TCP connection and seldomly sends data over it. The stateful firewall drops those connections after some timeout.
I would like to send TCP keepalives on the connection to avoid that. Of course this should be done by the device itself, but it doesn’t.
Maybe an alternative would be some trick to “close” the connection after some time.
However, the closest I see I could come to this is to have a stateful firewall in the MikroTik itself that passes open TCP session
and rejects other TCP data with “TCP Reset”. Unfortunately the parameters for times cannot be set depending on source address
or port number or other variable parameters, because the newly introduced “raw” table does not have such actions yet.
So I would have to set the global TCP connection tracking timeout for idle sessions very low (like 3 minutes), possibly introducing
problems for other devices.
So being able to insert TCP keepalives would be a real lifesaver, although I understand that is an extremely unusual feature for a router.