Cisco Support Community
Community Member

Prime 2.1 template to update NTP with parent device's IP

So I have several hundred branch devices.. Cisco 2821's with an integrated switch module.  Each device is setup the following: 10.x.x.1 (router) and 10.x.x.2 (switch).  I want to update my NTP server statements on the switch to be the router IP (.1).  I am trying to find a way to do this with the VTP scripting and was wondering if anybody had a better way.

My thoughts are to use a DB variable to pull the IP Address of the current device ($IPAdress) and use slice to get rid of the last octet, .2, and add .1 to it.


Here is what I am thinking:

#set( $ipadd = $IPAddress )
#set( $network = $ipadd.substr(0).slice(0, -1)
#set( $ntpserver = $network + "1" )
ntp server $ntpserver


I tried to create this template in PI, but I'm having a problem when I deploy.  How would I setup the variables for this with the managed variable tab?  I shouldn't have to fill in any values for the variables due to it all being set off of the DB IPAddress variable correct?


Any thoughts or input on how to make this process easier?


Everyone's tags (1)
Community Member

Did you ever work this out? I

Did you ever work this out?


I'm trying to do the same thing with an access list. I need to add a host to an access list based on the site subnet which I was hoping to get from the switch vlan management IP address

CreatePlease to create content