Question about static routing

Hello everyone.

I’m just getting started on the RouterOS world and I have a question for ya :smiley:

My config is simple enough, 2 wan and 1 lan.

My 2 wan are dhcp from the same isp.

So here’s the network:

LAN: 192.168.5.1/24
WAN1: Let’s assume that my isp gives me this gateway: 10.0.10.1

I’m not getting into load balancing or failover yet.

I have a group of ip’s that I want to route through one of the wan interfaces.
I have created my ip address list called Group1 with these IP range: 192.168.5.5-192.168.5.15
My first wan interface is called wan1
I have created the prerouting to mark the conection.

I’m having a problem setting this up due to the fact that when I create my static route using the interface as gateway I loose Internet conection. If I create it using my isp’s gateway IP address it works just fine.

So this works:
/ip route
add dst-address=0.0.0.0/0 gateway=10.0.10.1 disabled=no distance=10

This doesn’t:
/ip route
add dst-address=0.0.0.0/0 gateway=wan1 disabled=no distance=10

Now, I could just use the given gateway IP address but, I have noted that my isp changes not only my ip address but also the gateway so I would have to change it manually everytime this happens.

Any help with this is appreciated.