With multiple virtual wan interfaces created, assigning one of them to a specific device

Hello.
Through macvlan I have successfully created two wan interfaces, each holding an IP that my ISP has assigned to me.
Now I want one of my devices to connect solely through one of the interfaces in both direction. It would be better if other LAN devices can still reach it.
I had found a lot of tutorials concerning my case, but none seems to help. For example https://openwrt.org/docs/guide-user/network/wan/multiple_public_ips just break the Internet connection.

You can try mwan3 or PBR using custom routing tables and IP rules.

1 Like

PBR? And doesn't mwan3 aim on load balancing?
And...I seek a solution utilizing iptables, if possible.

Assign each upstream interface to a separate routing table.
Create IP rules to use a specific routing table based on the source/destination interface/subnet.

1 Like

This seems like something a simple SNAT can solve.