I have a pppoe connection with dynamic IP from ISP.
Needed a static IP, so I got one from a company that offers them through a pptp connection.
This pptp connection is established over the pppoe connection which is the only internet access I have.
Setup a dstnat rule:
/ip firewall nat add action=jump chain=dstnat in-interface=pptp-static jump-target=static-chain
/ip firewall nat add action=dst-nat chain=static-chain dst-port=21 protocol=tcp to-addresses=10.20.10.1 to-ports=2100
When I try to establish a connection the packets come to the destination server:
forward: in:pptp-static out:br_local, proto TCP (SYN), <client ip>:31128->10.20.10.1:2100, NAT <client ip>:31128->(<static ip>:21->10.20.10.1:2100), len 60
But the response is not sent back via the pptp-static interface, it is sent back via the pppoe interface:
forward: in:br_local out:pppoe-internet, src-mac <hidden>, proto TCP (SYN,ACK), 10.20.10.1:2100-><client ip>:31128, NAT (10.20.10.1:2100-><static ip>:21)-><client ip>:31128, len 60
Of course this doesn’t work and the client does not pick up the response.
I realize I could do something like:
/ip route add distance=1 gateway=pptp-static routing-mark=Route-Over-Static
/ip firewall mangle add action=mark-routing chain=prerouting new-routing-mark=Route-Over-Static passthrough=no protocol=tcp src-address=10.20.10.1 src-port=2100
But this would mean that the service would now only be available through the static connection, and makes it harder to add new services (ports) on this static ip connection.
The other problem is that this is a FTP server and when the mode switches to passive, the port will change and the response will go over pppoe again.
Is there some way to make the response always use the same interface from which the request came?
EDIT: I should also mention that I don’t want all my traffic going through the static IP, it should only be used for specific things like this. The rest of the traffic needs to go through the pppoe interface.