Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
yishaia
Explorer

Change gateway routes

Hello,

 

I need to change route destination on multi static routes,

i want to leave the comment that i added before,

and just replace the destination to a new one.

current destination 10.30.30.1 - new destination 10.30.30.254

how can i replace it by script to all routes, and not change/delete one by one?

example :

192.168.78.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.197.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.195.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.50.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.194.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.73.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.49.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.193.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.72.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.48.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.192.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.47.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.223.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.222.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.84.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.220.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.83.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.43.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.82.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.42.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.81.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.41.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.40.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.39.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.215.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.38.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.37.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.213.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.36.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.35.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.210.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.33.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.209.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022
192.168.208.0 10.30.30.1 255.255.255.0 UGD 0 0 0 eth1-01.1022

0 Kudos
8 Replies
_Val_
Admin
Admin

Why not putting clish config to a text file? Then it is replace/copy/paste operation

 

0 Kudos
yishaia
Explorer

Hello,

 

I want to keep the comments,

will it keep it?

0 Kudos
abihsot__
Advisor

execute "show configuration" and you will get something like this:

set static-route x.x.x.x/24 comment test
set static-route x.x.x.x/24 nexthop gateway address y.y.y.y priority 1 on

you can use those commands to change comments and gateways if needed.

0 Kudos
yishaia
Explorer

Hello,

 

thanks,

I did :

clish -c "show configuration" |grep "static" > /var/my_config.txt

and edit the file to the new routes.

I want to make the .txt file to a .sh script and run it,

and not to change the routes with copy&paste.

how can I do it?

thanks

0 Kudos
yishaia
Explorer

hi,

 

anyone knows how to do it?

 

thanks

0 Kudos
_Val_
Admin
Admin

Why do you need a script? CLISH does not allow scripted execution. You either need invoke GAIA API or add clish -c "......" for each entry in your .txt file. 

Either way is much more complex than copy/paste we suggested already.

0 Kudos
yishaia
Explorer

thanks,

but there is 700 lines,

when I copy&paste it into putty some of the lines do not paste complete.

and there is missing letters, so the command of some routes incomplete.

what can I do about it?

thanks

0 Kudos
_Val_
Admin
Admin

Why would you need to have 700 static routes on a FW? You may want to re-think your network design, I am afraid...

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events