Change Default route, no ping

Hello,

Here is my configuration:

I have 2 PPPOE sessions (Coax + XDSL). Both pings.
Coax is primary with default route: 1
XDSL is in secondary with default route: 2

When I change the coax to the default route: 5, the XDSL takes over and switches to primary. I have internet, everything works, but the coax is no longer pingable.

When I put the coax back to 1, it switches to primary and I can surf on the coax.

Why is it that when it switches to secondary, we can no longer ping it even though it is running in PPP and I have the Dynamic IP in IP Address displayed.

Sorry for my English, I’m Belgian.

Probably because you only have a path for 0.0.0.0/0 to gateway of VDSL and Coax with each having their distance and no specific path towards your Coax gateway (or VDSL gateway). Just guessing since you did not provide any further info.

Distance makes sure the first one which gets found for the same route, is applied.
But if there is only 0.0.0.0/0 gateway, it will never know how to go to that coax gateway.
Can you provide terminal output of /route print ?

Why do you change the distance on that route ? The best way to test is to simply remove the coax connection (ideally: power down the modem). And then you will see VDSL will take over.
Put modem back in, coax will take over again.
That’s what distance does for same route.

That’s no excuse for me. You do know we’re ranked 7th in the world for non-native English speakers ? :laughing:
Your English is just fine.

In fact, I’m new to a company that uses Mikrotik, and I like doing labs, where I learn on my own.

I was doing some tests, I had to do them on the XDSL (On the VLAN 10), so I put the coax in 5 so as not to get up in the workshop and that’s when I noticed the “problem”.

I thought of the exact path 0.0.0.0/0 but I have the two paths to pppoe-xdsl: 2 and pppoe-coax: 1 . Which must correspond to my two PPPOE sessions.

I thought I heard something about “Mangles” rules but it’s a bit vague.

Thanks :slight_smile:

Hello,

I’ve found the solution.

Coax session (dynamic route: 1) (primary): ppp-coax
xDSL session (dynamic route: 2) (secondary): ppp-xdsl

When I change the route from coax to 5, it changes dynamically but no longer pings. Here’s how to fix it.

/routing/table/add name=ping-ppp

/ip/firewall/mangle add chain=prerouting in-interface=ppp-coax packet-mark=no-mark connection-state=new action=mark-connection new-connection-mark=ping passthrough=yes

/ip/firewall/mangle add chain=output connection-mark=ping action=mark-routing new-routing-mark=ping-ppp passthrough=yes

/ip/route add dst-addresse=0.0.0.0/0 gateway=ppp-coax routing-table=ping-ppp

In my case it works directly, but strangely I don’t have this problem on all mikrotiks with the same config’.

Too funny Holvoe,
I read, that as SORRY I’m Belgian. :stuck_out_tongue_winking_eye:

To be clear there is no discovery its all just logic.
You attempt to ping the the router on WAN2.
The router responds from WAN1 because WAN1 is primary.

The solution as you figured out is to ensure the router responds from the same WAN.
Mangling is required. The only difference is I use mark connections, its more efficient that packets, and I also use the input chain rule because that is actually more accurate although pre-routing works just fine.I also dont use connection state=new, I use no-mark and only use =new, whenever no-mark is not sufficient (rare).
Finally, passthrough should be no after the routing decision. ( I dont use words that can be confused with functionality available on the the router hence pingg vice ping).

So it would look like:

/routing/table/add name=use-WAN2

/ip/firewall/mangle add chain=input in-interface=ppp-coax connection-mark=no-mark action=mark-connection new-connection-mark=pingg passthrough=yes

/ip/firewall/mangle add chain=output connection-mark=pingg action=mark-routing new-routing-mark=use-WAN2 passthrough=no

/ip/route add dst-addresse=0.0.0.0/0 gateway=ppp-coax routing-table=use-WAN2



One last step since you are mangling its now required to ensure that traffic is excluded from fasttrack in the forward chain, so as to not slow the router down.
add action=fasttrack-connection chain=forward comment=“defconf: fasttrack”
connection-state=established,related connection-mark=no

Hello Anav !

Thank you for your feedback. :slight_smile:

It was very informative!