11-16-2023 01:49 AM
Can we add ip route through compliance in CPI?
For example we have string
ip route 192.168.100.0 255.255.255.0 172.18.18.1we need to add new string with the same def gw 172.18.18.1:
ip route 192.168.200.0 255.255.255.0 172.18.18.1Can CPI check this string (ip route 192.168.100.0 255.255.255.0 172.18.18.1) write ip address 172.18.18.1 to variable <_def_gw> and implemet action ip route 192.168.200.0 255.255.255.0 <_def_gw>
Solved! Go to Solution.
11-16-2023 03:07 AM
check below guide :
=====Preenayamo Vasudevam=====
***** Rate All Helpful Responses *****
11-16-2023 02:19 AM
yes that is possible - is this for only 1 device or many device, check how you looking to deploy.
=====Preenayamo Vasudevam=====
***** Rate All Helpful Responses *****
11-16-2023 02:31 AM
we have about 500 devices where need to add new route but we need to use different GW for every device
11-16-2023 02:55 AM
Sure you can use PI - for testing i would advise to choose smaller numbers to test, if all good you can do stage level push for rest of the devices.
=====Preenayamo Vasudevam=====
***** Rate All Helpful Responses *****
11-16-2023 03:01 AM
but I do not know how PI can get the address to write it to a variable. I am using compliance PI to change some strings as dns/ntp/username or something else, but I have not found any example to check the running configuration to find the ip line route 192.168.100.0 255.255.255.0 172.18.18.1 and after that, write the found GW 172.18.18.1 as a variable to perform the action correction and add a new one route
11-16-2023 03:07 AM
check below guide :
=====Preenayamo Vasudevam=====
***** Rate All Helpful Responses *****
11-16-2023 08:35 AM
Can't understand meaning
To indicate the unique interface name in the message and command, you can type the variable
<n.m> in which:
n = The condition number
m = The grep value found in the condition
What is m exactly? I saw an default example on the PI ospf md5 <1.1> or <2.3> and didn't understand why is area from previous matches block equal <2.3>
11-16-2023 10:02 AM
So you looking to add device the new Router you looking to add
or you want to check
if the router has -
ip route 192.168.100.0 255.255.255.0 172.18.18.1
then add
ip route 192.168.200.0 255.255.255.0 172.18.18.1
=====Preenayamo Vasudevam=====
***** Rate All Helpful Responses *****
11-16-2023 04:24 PM - edited 11-16-2023 04:56 PM
Want to check
if the router has -
ip route 192.168.100.0 255.255.255.0 172.18.18.1
then add
Ip route 192.168.200.0 255.255.255.0 172.18.18.1
But the next-hop (in this example is 172.18.18.1) for every device is different
So for the 1st conditionI need to match the gateway, 2nd condition I need to write gateway to variable and check if router has Ip route 192.168.200.0 255.255.255.0 172.18.18.1 if not than perform fix Ip route 192.168.200.0 255.255.255.0 <1.1> and so for <1.1> I understand than 1 is number condition but what about second 1 and why for some examples we have <1.2> or <1.3>
11-16-2023 07:16 PM
I'm thinking I understood how can I do it. I will write the result
11-16-2023 09:26 PM - edited 11-16-2023 09:26 PM
Thanks for documentation
Condition 1 - We check ip route in the config
Condition 2 - We check if we have new route and if not we fix through using variable from condition 1
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide