Page 1 of 1

Find Problem,

Posted: Sun Sep 04, 2005 2:38 am
by williamm
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

Posted: Wed Oct 05, 2005 10:12 pm
by ela002
Anybody? How to run bgp commands via scripting?

Posted: Mon Oct 10, 2005 5:12 pm
by Eugene
Like any other command.