Mark packets by interface IP

Hi,

I am trying to add 2 ip addresses on the lan interface and route packages based on the ip address. In effect i would like to be able to change the gateway on a client pc and route packages through a different wan connection. The ip addresses must be sequential e.g. 192.168.0.100 & 192.168.0.101.
Anyone know how i can mark the packages based on the gateway ip?

Why not mark for routing based off of just the src-ip address? Easier to control and setup. I don’t think there is a way you can mark routing like you are asking for.

Because i want to select the route from the client (by changing the gateway)

Could i use vlans perhaps? (just a thought)

Or even better create virtual interfaces
http://wiki.mikrotik.com/wiki/Manual:Interface/Virtual-ethernet

That would give you multiple routed interfaces, and would require completely reassigning the IP address of the computer. From your description you wanted everything on the same subnet. You could run multiple subnets and do it based off of the src-address of the client. For example 192.168.0.0/24 would go out one link and 192.168.1.0/24 would go out the secondary.

No, i need them on the same subnet.

One thing that comes to my mind is to create an VRRP interface, put there the second IP, and route mark traffic depending on the incoming interface… I’m not sure that it would work, but you may give it a try and let us know.

Other option (if your hardware supports it) could be to create a Metarouter inside your routerboard and you’ll have 2 routers in the same hardware.

Thanx, i will try it and get back.