How to map incoming and outgoing traffic to sperate wan ip?

Ok ...
So I assume you are currently using only one of the 2 IP addresses for the uplink, they share the same gateway, and the bottleneck is not in your physical network. I'm also gonna assume you know what you are doing.
In that case you can make a script that bounces between:
iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to 1.x.x.x
iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to 2.x.x.x
and use conntrack -L (install conntrack) to measure bandwidth used by each IP.

Or you can create a second wan logical interface using the same physical interface, eth1, and put the second IP on that second logical interface. Then, you can install mwan3 and mwan3-app-luci, and play with that. Never used it myself.

1 Like

What is the reasoning behind choosing different source IPs for different uploads considering that they both travel over the same physical link? Is this a kind of privacy thing, or in order to appear to be from a single server like for load balancing?

It seems unlikely that you will get any performance boost, unless perhaps the ISP has a per-ip-address traffic shaper, and they have given you two different IP addresses so you have two different shapers. If that's what you're trying to do, then I suggest mwan3 approach.