Easy way to wipe out routes

I am working on a project on resetting up our IP network. I know how to make a script that can change IPs on interfaces but is there a way I can have the script wipe out all existing routes on the unit to reset with new routes.

Yes. You can change static routes with scripts.

It might be nicer to start using a routing protocol, though.

 /ip route remove [find]

This will clear out all static routes.

Thanks That is what I needed. With replacing IPs on interfaces. If ether8 is set to 192.168.100.1 and I want to change it to 192.168.1.1 will this work?

ip address set address=192.168.1.1/24 [find interface="ether8"]

you shouldn’t even need to find, just use

/ip address set address=192.168.1.1/24 interface=ether8

Sadly it doesn’t work that way since that doesn’t update the network and broadcast address parameters. You either have to update all three, but then you have to be sure to get the values right. I tend to just remove the IP address and add a new one:

/ip address
remove [find interface="ether8"]
add address=192.168.1.1/24 interface=ether8

I see. I forgot that it will not set that part.

Thanks for all the help