I have 3 public gateways. I am using load balancing setup exactly like the example on wiki with mangle and src-nat masquerading on the LAN. Everything works great but I can’t get the private IPs to go to the gateway I setup with the mangle and route. It jumps around to all 3 of the gateways.
Sometimes it will jump to one of the Public IPs that are on the Public Interface that are being used for dst-nat.
Use mange to route mark packets you want to direct to specific gateway and then i routes set static route with apropriate route mark. That routw would work only for packets marjed properly. if that route has lower metrics than default route, then it would send marked packets to destined gateway.
I added a new mangle rule with action mark routing for the src address. I then added the default route and gateway for the new group. Still doesn’t work.
Well, “Still doesn’t work.” Is not very helpful information. Try to be more informative. The first thing that leads to the solution is to find what exactly does not work.
Setting routing may be tricky and requires you to know what you are doing, especially if you are using route-marks.