Community discussions

MikroTik App
 
williamm
just joined
Topic Author
Posts: 13
Joined: Sun Apr 03, 2005 2:51 am
Location: Brazil

Find Problem,

Sun Sep 04, 2005 2:38 am

Since I have several gateways (one without routing mark and others with routing marked for routing policy), I need to change them in a script. Using the exact example in docs (below), it changes all my default gateways.

/ip route set [/ip route find dst-address="0.0.0.0/0"] gateway 10.0.0.1]

How could I select them? I could note the find use the following arguments:

dst-address -- Destination address
prefsrc -- Source address of packets leaving the router
gateway --
check-gateway -- Whether all nexthops of this route are checking reachability of gateway by sending arp requests every 10 seconds
interface -- Interface through which the gateway can be reached
gateway-state -- Shows the status of the next hop
distance -- Administrative distance of the route
scope --
target-scope --
routing-mark -- It's used for policy-routing
from -- item numbers
active --
dynamic --
connect --
static --
rip --
bgp --
ospf --
comment -- short description of the item
disabled --


I can change the routing marked gateways using

/ip route set [/ip route find dst-address="0.0.0.0/0" routing-mark="mark"] gateway 10.0.0.1]

But if I try to change the gateway without routing mark, it doesn't work. I've tried the following without success:

/ip route set [/ip route find dst-address="0.0.0.0/0" routing-mark=""] gateway 10.0.0.2]

/ip route set [/ip route find dst-address="0.0.0.0/0" gateway="192.168.0.1"] gateway 10.0.0.2]

/ip route set [/ip route find dst-address="0.0.0.0/0" interface="ifname"] gateway 10.0.0.2]


How could I solve that? The interface and gateway arguments doesn't work?

William
 
ela002
Frequent Visitor
Frequent Visitor
Posts: 97
Joined: Tue May 31, 2005 4:19 am

Wed Oct 05, 2005 10:12 pm

Anybody? How to run bgp commands via scripting?
 
User avatar
Eugene
Forum Veteran
Forum Veteran
Posts: 986
Joined: Mon May 31, 2004 5:06 pm
Location: Cranfield, UK

Mon Oct 10, 2005 5:12 pm

Like any other command.