we have 2 ip addresses on one interface . those 2 ip are gateways for different ip addresses .
how we can mangle which ip addresses routed from outside to 192.168.10.1 and which ip addresses routed from outside to 192.168.11.1 ?
/ip route print
0 A S dst-address=0.0.0.0/0 gateway=192.168.10.1 gateway-status=192.168.10.1 reachable ether1 distance=1 scope=255 target-scope=10
routing-mark=first-route-mark
1 A S dst-address=0.0.0.0/0 gateway=192.168.11.1 gateway-status=192.168.11.1 reachable ether1 distance=1 scope=255 target-scope=10
routing-mark=second-route-mark
Don't overload IP addresses on the same broadcast domain just like you shouldn't be, anyway. Overloading IPv4 addresses is ugly. Use VLAN subinterfaces instead for the different networks. That'll keep the physical link down to one, but allow you to use in-interface on router B as it would be the VLAN subinterface instead of the physical interface.at routerAat routerB i have 192.168.10.1 and 192.168.11.1 on ether3 . now how i can detect (on routerB ) which ip addresses routed from routerA to 192.168.10.1 and which ip addresses routed to 192.168.11.1 ?Code: Select all/ip route print 0 A S dst-address=0.0.0.0/0 gateway=192.168.10.1 gateway-status=192.168.10.1 reachable ether1 distance=1 scope=255 target-scope=10 routing-mark=first-route-mark 1 A S dst-address=0.0.0.0/0 gateway=192.168.11.1 gateway-status=192.168.11.1 reachable ether1 distance=1 scope=255 target-scope=10 routing-mark=second-route-mark
Maybe no in near future .DSCP can easily cope with 50 different routes, as I recall it is actually limited to 63 or 64? Is that not enough? You did originally only state that you had two routes to identify.
You are right . sorry . i am lazyIt is always better to give the whole story when posting than to over-simplify and then have to change it when our answer is not good for you. LOL
I am doing it with vlans right now but i am trying to find a way without vlan . main problem is when i put such number of vlans on router it starts some strange behaviors . without vlans everything is fine .Don't overload IP addresses on the same broadcast domain just like you shouldn't be, anyway. Overloading IPv4 addresses is ugly. Use VLAN subinterfaces instead for the different networks. That'll keep the physical link down to one, but allow you to use in-interface on router B as it would be the VLAN subinterface instead of the physical interface.
I know and agree and using it right now .The proper solution to your problem is to use VLANs, so it might be worth investing some more time in getting that to work. It's a good, clean solution.
Main problem is at routerA . it is pppoe concentrator and creating many vlans causes random ppp crashes on it . but it is not the purpose of this topic .Can you quantify "weird behavior"?
It is a little tricky . the main idea comes from here http://forum.mikrotik.com/viewtopic.php?f=2&t=34792 . i have some dynamic address-lists on routerA which i want them on routerB . syncing with api is not so easy and reliable . so i am trying to mark each address-list with a routing-mark and route it to a unique ip of routerB . in routerB each ip that routed to specific ip should include in specific address-list .Alternatively, why do you need this at all? What is the reason for wanting to determine what gateway a packet arrived through? Outside a persistent packet mark (DSCP) that isn't really possible if you don't have an interface to go with it. If you're using some mechanism on the downstream router to determine which gateway it is supposed to use for certain traffic streams wouldn't you be able to use the same classification on the upstream router and re-mark based on the same criteria, such as source address?