cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
giulio
Level 9
Report Inappropriate Content
Message 1 of 3

multiple static routes

Jump to solution

Is there a way to add multiple static routes on web gateway ?

I have about 70 routes to be added, i have 5 web gateways...

It is strange that there is no a field for massive insert for static routes... every network device has one...

If i add via CLI, then i lose them at reboot...

I have 7.8.2.8.0 version

thanks for suggestions

Giuliano

 

 

Labels (1)
1 Solution

Accepted Solutions
aloksard
Employee
Employee
Report Inappropriate Content
Message 2 of 3

Re: multiple static routes

Jump to solution
Hi Giuliano,
 
Hope you are doing well.
 
You can do this using REST API interface
 
Below is  a POC bash shell script which illustrates how to check or change the MWG's Static Route configuration via REST API.
 
In the future, we hope to implement a more convenient way to bulk-add Static Routes; however, that is not currently planned for an upcoming release, so the REST API is the best path forward at the moment.
 
You can refer below link for more info on REST API:-
 
 
Page 442
 
 
Script:-
 

#!/bin/bash
REST="http://127.0.0.1:4711/Konfigurator/REST";
area="appliances"
setting="configuration/com.scur.engine.appliance.routes.configuration/property";
property="network.routes.ip4";

echo "Login to UI"
curl -k -s -c cookies.txt -H "Authorization: Basic YWRtaW46d2ViZ2F0ZXdheQ==" -X POST "$REST/login" > /dev/null

echo -e "Print list of MWG UUIDs within the cluster\n"

curl -k -s -b cookies.txt "$REST/appliances" -H 'Content-Type: application/xml; charset=UTF-8'
echo -e "\n\n ^ The single appliance in my cluster is listed as \"<id>4208e5e8-b21e-073d-e67f-fbd3a833b8f0</id>\" ^"
echo "Appliance UUIDs can also be found through the UI by selecting \"Configuration->Appliances\". When this is selected, the UUID/Hostname/etc is displayed in the bottom-right pane."

UUID="4208e5e8-b21e-073d-e67f-fbd3a833b8f0"
FullRest=$REST/$area/$UUID/$setting/$property;

echo "Write the current Static Route configuration for $UUID to $UUID.xml"
curl -k -s -b cookies.txt -X GET "$FullRest" -H 'Content-Type: application/xml; charset=UTF-8' > $UUID.xml

echo "Edit the Static Route configuration as needed before continuing"

echo "Overwrite Static Route configuration for $UUID"
curl -k -s -b cookies.txt -d @$UUID.xml -X PUT "$FullRest" -H 'Content-Type: application/xml; charset=UTF-8'; > /dev/null

echo "Save changes (will trigger a network service restart)"
curl -k -s -b cookies.txt -X POST "$REST/commit"

echo "Logout from UI (not usually needed due to the service restart, but a good habit nonetheless)"
curl -k -s -b cookies.txt -X POST "$REST/logout"

 
Regards
Alok Sarda

View solution in original post

2 Replies
aloksard
Employee
Employee
Report Inappropriate Content
Message 2 of 3

Re: multiple static routes

Jump to solution
Hi Giuliano,
 
Hope you are doing well.
 
You can do this using REST API interface
 
Below is  a POC bash shell script which illustrates how to check or change the MWG's Static Route configuration via REST API.
 
In the future, we hope to implement a more convenient way to bulk-add Static Routes; however, that is not currently planned for an upcoming release, so the REST API is the best path forward at the moment.
 
You can refer below link for more info on REST API:-
 
 
Page 442
 
 
Script:-
 

#!/bin/bash
REST="http://127.0.0.1:4711/Konfigurator/REST";
area="appliances"
setting="configuration/com.scur.engine.appliance.routes.configuration/property";
property="network.routes.ip4";

echo "Login to UI"
curl -k -s -c cookies.txt -H "Authorization: Basic YWRtaW46d2ViZ2F0ZXdheQ==" -X POST "$REST/login" > /dev/null

echo -e "Print list of MWG UUIDs within the cluster\n"

curl -k -s -b cookies.txt "$REST/appliances" -H 'Content-Type: application/xml; charset=UTF-8'
echo -e "\n\n ^ The single appliance in my cluster is listed as \"<id>4208e5e8-b21e-073d-e67f-fbd3a833b8f0</id>\" ^"
echo "Appliance UUIDs can also be found through the UI by selecting \"Configuration->Appliances\". When this is selected, the UUID/Hostname/etc is displayed in the bottom-right pane."

UUID="4208e5e8-b21e-073d-e67f-fbd3a833b8f0"
FullRest=$REST/$area/$UUID/$setting/$property;

echo "Write the current Static Route configuration for $UUID to $UUID.xml"
curl -k -s -b cookies.txt -X GET "$FullRest" -H 'Content-Type: application/xml; charset=UTF-8' > $UUID.xml

echo "Edit the Static Route configuration as needed before continuing"

echo "Overwrite Static Route configuration for $UUID"
curl -k -s -b cookies.txt -d @$UUID.xml -X PUT "$FullRest" -H 'Content-Type: application/xml; charset=UTF-8'; > /dev/null

echo "Save changes (will trigger a network service restart)"
curl -k -s -b cookies.txt -X POST "$REST/commit"

echo "Logout from UI (not usually needed due to the service restart, but a good habit nonetheless)"
curl -k -s -b cookies.txt -X POST "$REST/logout"

 
Regards
Alok Sarda
giulio
Level 9
Report Inappropriate Content
Message 3 of 3

Re: multiple static routes

Jump to solution
thank you!
You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use our Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from product experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by employees.
Join the Community
Join the Community