Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Matlu
Advisor
Jump to solution

Static Routes in VS

Hello,
Is there a way to create many static routes by a script for a VSX environment?
We have quite a large list of static routes that we need to create in some instances (VS) of our VSX Cluster, and we want to know if we can use some “automated” to accomplish this task.
Thanks for your recommendations.

0 Kudos
1 Solution

Accepted Solutions
Chris_Atkinson
Employee Employee
Employee
8 Replies
the_rock
Legend
Legend

Maybe script like below?

#!/bin/bash

# Set the VSID you want to configure
VSID=3
vsenv $VSID

# Define your routes as destination/gateway/interface
ROUTES=(
"10.0.1.0/24 192.168.1.1 eth1"
"10.0.2.0/24 192.168.1.2 eth2"
"10.0.3.0/24 192.168.1.3 eth3"
)

for ROUTE in "${ROUTES[@]}"; do
set -- $ROUTE
DEST=$1
GW=$2
IFACE=$3

clish -c "add static-route $DEST nexthop gateway address $GW on interface $IFACE"
done

clish -c "save config"

0 Kudos
Chris_Atkinson
Employee Employee
Employee

Static routes are not configurable (supported) via CLI for VSX locally on the gateway, this information is deployed via Management.

Also one of the advantages of VSnext was API parity.

CCSM R77/R80/ELITE
0 Kudos
the_rock
Legend
Legend

Im pretty positive you can (I had done it before), but cant recall exactly how...had to do some changes via vsx_provisioning_tool on mgmt first.

Andy

0 Kudos
Matlu
Advisor

So, there is no “automated” way to accomplish this task?

You can only manually (1x1) configure the routes through the SmartConsole?

0 Kudos
Chris_Atkinson
Employee Employee
Employee

There is no API only the vsx_provisioning_tool (which you can use in batches) that I posted a link to that is run from the Mgmt.

Refer: https://www.youtube.com/watch?v=Tbgg64zB-vk by @Magnus-Holmberg 

CCSM R77/R80/ELITE
0 Kudos
the_rock
Legend
Legend

Definitely no API bro.

Andy

0 Kudos
_Val_
Admin
Admin

Nope, the only correct way is to set routes on the MGMT side. VSX provisioning tool is the answer, if you want to set many routes.

0 Kudos
Chris_Atkinson
Employee Employee
Employee

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events