IP NAT only when connecting to specific IP

Hi! I have DHCP setup with address pool 10.2.0.0/24. What I want to achieve is that when I connect to 10.50.50.4 with 80 and 443 ports (just example) then outgoing address pool is 10.3.0.0/24. It’s should be like - my PC has IP 10.2.0.15 assigned. I’m connecting to 10.50.50.4:80 via web browser. My outgoing IP to 10.50.50.4 is 10.3.0.15 (or 16, 17.. whatever). What do I need to do in this situation? Is it enough just to create NAT rule or I need to create separate DHCP pool as well?

here i actualy cant understand what you mean. If you connect to ip xxx.yyy.zzz.aaa port 80 - there is no more “outgoing” ip. This server will respond, and send traffic back to you.

The src-nat rule can have additional match conditions as any other rule.

So if you set

/ip firewall nat
add chain=srcnat action=src-nat to-addresses=10.3.0.15 dst-address=10.50.50.4 protocol=tcp dst-port=80,443

your source address for connections to 10.50.50.4’s port 80 or 443 will be changed to 10.3.0.15, but if you connect to another address, or to another ports on 10.50.50.4, your source address will remain unchanged.