Community discussions

MikroTik App
 
jarda
Forum Guru
Forum Guru
Topic Author
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

Exclude particular IP address from default route

Wed Apr 16, 2014 1:56 pm

Hello,
is there any simple way how to exclude specific IP address from default route? I can imagine to mangle according to destination ip and then exclude the routing mark from default route. But is it possible to do it without mangling?

Anyway, I checked it again and it seems that it is not possible to exclude the routing mark. It would be necessary to mark all traffic, and just selected destination keep without routing mark and then add the routing mark to the default route as positive condition. This is something I would not want to do .

Yes, I am using specific routing for this ip, but it is linked to certain interface. When the interface is down, the route is disabled, so the traffic goes by default route, therefore I want to exclude it.

Thank you.
 
CelticComms
Forum Guru
Forum Guru
Posts: 1765
Joined: Wed May 02, 2012 5:48 am

Re: Exclude particular IP address from default route

Wed Apr 16, 2014 2:30 pm

You can use a rule in /IP Route. Mark the explicit rule with a routing mark and set a rule to use that routing mark/table only for the specific target.
 
jarda
Forum Guru
Forum Guru
Topic Author
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

Re: Exclude particular IP address from default route

Wed Apr 16, 2014 2:57 pm

Yes, I am using specific routing for this ip, but it is linked to certain interface. When the interface is down, the route is disabled, so the traffic goes by default route, therefore I want to exclude it.
As I wrote, I already have such special route. The problem is, when it becomes inactive. Then the default route takes also this traffic, therefore I want to exclude it.

I have another idea. Make additional route with higher distance for my distance and use 127.0.0.1 as GW. It should become active in case the own special route goes inactive and it could exclude the traffic effectively.

Any other idea?
 
CelticComms
Forum Guru
Forum Guru
Posts: 1765
Joined: Wed May 02, 2012 5:48 am

Re: Exclude particular IP address from default route

Wed Apr 16, 2014 3:12 pm

Try posting your config. Using a routing rule with action "lookup only in table" should be able to achieve this. It should the return "destination net unreachable" if the interface for the explicit route is down.
 
jarda
Forum Guru
Forum Guru
Topic Author
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

Re: Exclude particular IP address from default route

Thu May 01, 2014 10:56 pm

I owe response here. Thank you for your willingness first. I solved my problem by creating additional route for that destination with blackhole type and higher distance. In case the main route is not accessible, it deactivates the real route and then this fictive blackhole route takes its place and discards the packets as I wanted.
Hope it helps someone.
 
CelticComms
Forum Guru
Forum Guru
Posts: 1765
Joined: Wed May 02, 2012 5:48 am

Re: Exclude particular IP address from default route

Thu May 01, 2014 11:02 pm

Glad that solved the problem. If you want RouterOS to *only* use routes in a particular VRF (routing-mark) you can always use routing rules to force it to do so.

Who is online

Users browsing this forum: neitro, Sailwebwifi and 80 guests