Page 1 of 1

Packet mark routing

Posted: Wed Oct 04, 2006 8:29 pm
by jo2jo
I have a cable modem and a dsl modem on a rb 532...
the dsl is the primary gateway for all dest. traffic

i can setup a mangle rule to grab icmp's with a dst ip of the cable modem (the non primary link). I then set it to packet mark routing and give it a name. i then setup a route that says dst (ip of machine doing pining) use gateway of cable modem when you see the packet mark of the mangle rule.

I can see the mangle rule, sees my pings from a external MT router (different part of internet). but they do not route back.

if i simply remove the packet mark part of the route it works and the pings properly go back out across the cable modem (due to the dst. rule of the route)

any ideas? am i doing something to cause the route not to see my packets being marked by the mangle rule?


Posted: Wed Oct 04, 2006 8:41 pm
by Stryker777
in the mangle table make sure you added your rule in prerouting and also you want to use routing mark if you are going to change the route of something.

Posted: Wed Oct 04, 2006 11:02 pm
by jo2jo
yep, both of those were already done and the route still does not pick up the route packet mark

edit: do you think there is a conflict of somekind since i have two destinations of (all) each with different gateways? just one looks for a pakcket mark and one does not.

Posted: Wed Oct 04, 2006 11:29 pm
by jo2jo
ok i got it:

what i did was make two mangle rules:

one that marks the CONNECTION of the prerouting chaing that have the in. interface of the cable modem.

then a 2nd mangle rule that looks for that marked connection on the output chain and then gives it a routing mark which the route with the cable modems Gateway looks for.

so far so good..this maybe a clue to getting session persistance for load balencing a line.

Re: Packet mark routing

Posted: Mon Jul 21, 2014 12:03 pm
by el berto
May you post configuration?

I haven't understood...
you have DSL modem as primary connection (let's suppose DSL is then eth1 is
then default gateway is

Now you wand override default gateway rule: all traffic incoming from secondary modem (let's suppose connected to ether2) is also outgoing from ether2 regardless default gateway rule?
So all incoming from ether2 is also outgoing from ether2?

Re: Packet mark routing

Posted: Mon Jul 21, 2014 3:22 pm
by kameelperdza
Hi check this.

/ip route add dst-address= gateway=(cable modem) routing-mark=cable

/ip firewall mangle add src-address=(your pc) routing-mark=cable protocol=icmp

Re: Packet mark routing

Posted: Mon Jul 21, 2014 3:27 pm
by kameelperdza
If you remote router see your pings.

On remote router.

add this.

/ip route add dst-address=(your pc address or range) gateway=(the address of the rb532)

for example = /ip route add dst-address= gateway=

This rule will tell the remote router where to send the reply back.