Community discussions

MikroTik App
 
hippo
just joined
Topic Author
Posts: 24
Joined: Wed Mar 26, 2008 2:12 pm

Routing-mark on Output chain not working *SOLVED*

Mon Mar 31, 2008 11:29 am

Hi

I seem to have a problem with route mark on outgoing traffic from the RouterOS device.
Version used is ROS 3.6

If I do the following:

/ip route> add dst-address=192.168.0.0/24 gateway=10.0.0.1 routing-mark=test
/ip route rule> add routing-mark=test action=lookup table=test
/ip firewall mangle> add action=mark-routing chain=output disabled=no new-routing-mark=test src-address=10.0.2.1

(and don't have any default route in the main routing table). I get the following:

/ping 192.168.0.1 src-address=10.0.2.1
no route to host
no route to host

which means it doesn't look in the test routing table where I added the route but in the main routing table where there isn't any route for that network. Is there any way to solve this problem?


With hope for help,
Hippo
Last edited by hippo on Tue Apr 01, 2008 4:04 pm, edited 1 time in total.
 
gacopl
Frequent Visitor
Frequent Visitor
Posts: 63
Joined: Sun Jul 29, 2007 5:11 pm
Location: Poland

Re: Routing-mark on Output chain not working

Mon Mar 31, 2008 6:22 pm

delete the lookup rule i route table, mangle rule for routing does what's needed, and and table lookup just messes things, remmber to reboot after that, i had the same situation i removed route lookup and rebooted and it started to working. Also if you have multiple ips, and you want to start connection from the router (because normal situation is when you have multiple ips and for it a routing mark, when you ping that ip from other device then this rule will work) besides that marking rule for src-address you need a netmap/srcnat rule that will make sure that all connections from this router will be nated to this specific address (you can src-address-type=local for that)

cheers
Michal
 
hippo
just joined
Topic Author
Posts: 24
Joined: Wed Mar 26, 2008 2:12 pm

Re: Routing-mark on Output chain not working *SOLVED*

Tue Apr 01, 2008 4:18 pm

Hi!

Thanks for the help!

Allthough there was one more thing missing, you have to have a route for the network in the 192.168.0.0/24 in the main table. That route wasn't used but unless it was there it would not check the alternative routing table for a route for that network. I noticed this I didn't have any default route in the default routing table.

br
Hippo
 
gacopl
Frequent Visitor
Frequent Visitor
Posts: 63
Joined: Sun Jul 29, 2007 5:11 pm
Location: Poland

Re: Routing-mark on Output chain not working *SOLVED*

Fri Apr 04, 2008 1:26 pm

you have right i didn't notice it before but yes if you don't have route in main table even if it's pointing on strange gateway, system won't check alternate routing tables.

Thanks for clarifyin

Cheers

Who is online

Users browsing this forum: arcc, doka, Neojie, Renfrew, seriosha and 34 guests