Page 1 of 1

Wrong default route when router and modem start at the same time

Posted: Fri Sep 13, 2019 12:06 pm
by mode
Hi,

i am using a dsl modem with a mikrotik router. The router establishes a pppoe connection. When powercycling router and modem at the same time the router boots faster while the modem is still syncing with the dslam. But the modem has a dhcp server and gives a local ip 192.168. to the mikrotik router (only for connecting to the webif of the modem) The Router sets its default gateway to this ip. Even if the router established the pppoe connection the default route is not set to wan IP.
To fix this i have to reboot the router while the modem is synced. Then the correct default route to wan ip is set.
How can i fix this, so that i can boot the router while the dsl modem is not synced?


BR

Re: Wrong default route when router and modem start at the same time

Posted: Fri Sep 13, 2019 12:16 pm
by mkx
Set IP address to Mikrotik statically. Take any address from the same IP subnet as modem uses except from modem's own address (and network and broadcast addresses obviously).

pppoe-client on Mikrotik should add default route ... but be sure to enable "add default route" on PPPoE client configuration.

If the whole setup depends on default route pointing to modem's address, then it probably means that modem is establishing PPPoE as well. In this case you have two possibilities:
  1. Keep running PPPoE client on modem. Disable PPPoE client on Mikrotik. Drawback is that you actually have double NAT (once by Mikrotik and once by modem). It doesn't matter much if you don't have any use of port forwarding (either for accessing your LAN from internet or for some on-line games).
  2. disable PPPoE client on modem and properly configure Routerboard. Apart form enabling "add default route" on PPPoE client config, you'll probably have to add the pppoe-out1 (or whatever it is named in your setup) interface to interface list named "WAN". This is necessary for all the firewall perform properly (it affects both firewall filter rules and NAT).
    The benefit is that you only have NAT performed once, so you can establish some port-forwaring just by configuring Mikrotik.
    You will still be able to access modem's administrative page ...

Re: Wrong default route when router and modem start at the same time

Posted: Fri Sep 13, 2019 12:51 pm
by pe1chl
Don't do it so difficult... just set a higher "default route distance" in the Advanced tab on the DHCP client.
The DHCP client will add a default route with high distance (2 or higher) and later when your PPPoE client comes up it will set its normal distance 1 default route which will be used.

Re: Wrong default route when router and modem start at the same time

Posted: Fri Sep 13, 2019 2:08 pm
by mode
Thanks for your answers. i'll check it out and post the result here.

Re: Wrong default route when router and modem start at the same time  [SOLVED]

Posted: Fri Sep 13, 2019 5:43 pm
by Paternot
Wouldn't be easier just uncheck the "add default gateway", on the Mikrotik's DHCP client?

Re: Wrong default route when router and modem start at the same time

Posted: Fri Sep 13, 2019 11:09 pm
by mode
Wouldn't be easier just uncheck the "add default gateway", on the Mikrotik's DHCP client?
Yes, i did this and it works like it should. Thanks!