Hello.
I want to ask is there any way to do the fallowing configuration.
ether1 - clientX using subnet 192.168.1.0/24
ether2 - clientY using subnet 192.168.2.0/24
ether3 - ISP, but with 2 IP adresses with same gateway.
so that clientX has wan address 85.158.135.2/28 and clientY has wan address 85.158.135.3/28.
at this moment i have figured out how to make this if i have 2 ip adresses from ISP but from different subnets (different gateways).
That isn’t policy routing, since you’re routing to the same gateway - you just want to control NAT more tightly.
This should suffice once you’ve removed all other source NAT rules that could interfere. If you don’t know which might, post the ones you have for review. I’m showing all IP addressing and routing rules as well, though you presumably already have at least portions of them. I’m assuming 85.158.135.1 is the ISP gateway.
# apply IP addresses to WAN interface
/ip address
add address=85.158.135.2/28 interface=ether3
add address=85.158.135.3/28 interface=ether3
# apply IP addresses to LAN interfaces
add address=192.168.1.0/24 interface=ether1
add address=192.168.2.0/24 interface=ether2
# add default route
/ip route
add dst-address=0.0.0.0/0 gateway=85.158.135.1
# NAT depending on source address
/ip firewall nat
add chain=srcnat out-interface=ether3 src-address=192.168.1.0/24 action=src-nat to-address=85.158.135.2
add chain=srcnat out-interface=ether3 src-address=192.168.2.0/24 action=src-nat to-address=85.158.135.3