Changing a Router
All of the tools but one only read. The one that changes a router's running state is bgp_reset_neighbor.
flockmcp cannot change a router's configuration.
Allowing it
A reset is refused unless two settings both allow it. Neither is on by default.
-
flockmcpmust be started with--allow-actionsnaming the router:flockmcp --daemon r1=http://192.0.2.1:50051 --daemon r2=http://192.0.2.2:50051 --allow-actions r1Here an assistant may reset neighbors on
r1and not onr2. Give--allow-actionsonce for each router. -
The router must allow actions over its API, in the
systemsection of its/etc/flockd/flockd.json:"system": { "api": { "allow_actions": true } }flockdtakes a change to this setting without a restart.
list_daemons shows the first of these for each router, as allow_actions.
The assistant is told that bgp_reset_neighbor changes a router and that the other tools do not. Most assistants ask you before they call a tool that is marked so. Keep that turned on.
bgp_reset_neighbor
Resets a BGP neighbor. The same as flockc bgp vrf <vrf> neigh <neighbor> reset <reset>, where flockc writes the reset values with a hyphen in place of the underscore: soft-in.
| Argument | |
|---|---|
daemon | The router. It must be one that list_daemons shows with allow_actions true |
vrf | The VRF the neighbor is in. Leave out for the main VRF |
neighbor | The neighbor, as bgp_neighbors gives it in neigh_key |
reset | How to reset it |
reset | |
|---|---|
soft_in | Replay what the neighbor sent through its import policy. Does not disturb the session |
soft_out | Send the neighbor the BGP RIB again through its export policy. Does not disturb the session |
refresh_in | Ask the neighbor to send its routes again |
refresh_out | Send the neighbor its routes again, as if it had asked |
hard | Close the session and establish it again. Traffic through the neighbor is disrupted |
A reset that flockd carried out answers:
{
"reset": true,
"daemon": "r1",
"vrf": "default",
"neighbor": "10.0.12.2"
}
A reset is sent once
flockmcp checks the router is the one it expects immediately before it sends a reset, and never sends a reset a second time.
If the router restarts as the reset is sent, flockmcp cannot tell whether the reset reached it. It says so, and does not try again:
daemon r1 restarted while it was being asked to act. What was asked may have reached it, and is not asked again: look at its state before asking again