From one hand, it is written that “Usually at least one static route is required: a default route for the router pointing out to the ISP network.”
From the other hand, “Also note that it is not necessary or recommended to add a static default route if your router receives its WAN IP address via DHCP or PPPoE. Static default routes should only be used when the public IP address on the WAN interface is also static.”
So, I have a provider that gives me IP address via DHCP. But I did not have access to Internet until I added a static route:
/ip route add dst-address=0.0.0.0/0 gateway=
But then I got an external IP from my provider and lost internet connectivity because my gateway changed as well and I had to fix the default static route to point to the new gateway. So, how should it work with the dynamic IP from provider without the static route?
If I understand correctly, you are using dhcp-client in order to get your WAN IP from your ISP.
Did you enable the “add-default-route” option on your dhcp-client instance?
I am using a pppoe-client to connect to my ISP and on the pppoe-client interface, the “add-default-route” option is also available and I set it to “yes” which will give me a route towards my ISP.
This way, when your lease expires or you reset your modem/router all your traffic will be routed out through that gateway, not that IP address that is no longer working.
This is what my config ended up looking like:
Note: I have connected it to an existing network, so I am required to NAT out through the ISP’s modem/router.
This is my configuration that works:
If I’m setting /ip router add dst-address=0.0.0.0/0 gateway=ether1-gateway as suggested by CameronE, it says ‘reachable’, but I’m losing internet connectivity. The DHCP option add-default-route is set. So, any ideas, what’s wrong in my configuration above? Thanks!
Your ISP is sending classless routes to you on a wrong format. When classless
routes are used then also default route should be encoded in that option.
If you are using RouterOS version 6 you can overcome this problem by setting
add-default-route=special-classless in dhcp client settings
After I applied this option, I got the dynamic default route!