cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
977
Views
1
Helpful
10
Replies

Cisco prime add ip route via compliance

dijix1990
VIP Alumni
VIP Alumni

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.1

we 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.1

 Can 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>

1 Accepted Solution
10 Replies 10

balaji.bandi
Hall of Fame
Hall of Fame

yes that is possible - is this for only 1 device or many device, check how you looking to deploy.

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

we have about 500 devices where need to add new route but we need to use different GW for every device

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.

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

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

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>

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

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

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>

I'm thinking I understood how can I do it. I will write the result

Thanks for documentation

Condition 1 - We check ip route in the config

dijix1990_0-1700198556581.pngdijix1990_1-1700198584310.png

Condition 2 - We check if we have new route and if not we fix through using variable from condition 1

dijix1990_2-1700198682100.pngdijix1990_3-1700198720966.png

 

Review Cisco Networking for a $25 gift card