Creating and Applying Scope Templates
Scope templates apply certain common attributes to multiple scopes. These common attributes include a scope name based on an expression, policies, address ranges, and an embedded policy option based on an expression (see Using Expressions in Scope Templates).
Local Advanced and Regional Web UI
Scope templates you add or pull from the local clusters are visible on the List DHCP Scope Templates page. To get there, from the Design menu, choose Scope Templates from DHCPv4 submenu . This functionality is available only to administrators assigned the dhcp-management subrole of the regional central-cfg-admin or local ccm-admin role.
To explicitly create a scope template, click Add Scope Templates on the Scope Templates pane. This opens the Add DHCP Scope Template dialog box, which includes the template name. You can also choose an existing policy for the scope template. The other fields require expression values (see the "Create a Scope Template" section in the Cisco Prime Network Registrar 10.0 Administration Guide that describes these fields).
Related Topics
Using Expressions in Scope Templates
Additional Scope Template Attributes
CLI Commands
Create a scope template using scope-template name create [attribute=value ...]. For example:
nrcmd> scope-template example-scope-template create
You can also associate a policy with the scope template:
nrcmd> scope-template example-scope-template set policy=examplepolicy
Additional Scope Template Attributes
The optional additional attributes appear in functional categories. For a description of each attribute, click the attribute name to open a help window. For example, you might want to enable dynamic DNS updates for the scope, or set the main and backup DHCP failover servers.
After you complete these fields, click Add Scope Template .
Editing Scope Templates
To edit a scope template, select its name from the Scope Templates pane. The Edit DHCP Scope Template page is essentially the same as the Add DHCP Scope Template page (see Creating and Applying Scope Templates) except for an additional attribute unset function. Make your changes, then click Save.
nrcmd> scope-template example-scope-template set policy=default
Applying Scope Templates to Scopes
You can apply a scope template to a scope in a few ways.
Caution |
Be careful applying a scope template to an existing scope. The template overwrites all the scope attributes with its own, which can have a detrimental effect if the scope is active. |
Local Advanced Web UI
-
When a template is applied to a target—If the scope-template has an embedded policy, it is copied to the scope. This embedded policy may or may not have options. As the entire scope-template's embedded policy is used (if it exists), it will wipe out any existing options in the scope. If the scope-template has no embedded policy, the scope's embedded policy is retained. Next the scope-template's option expression, if any, is evaluated and the options are added to the embedded policy options in the scope (if no embedded policy exists, one is created).
- While creating a scope, derive its name from the template—If you set a Scope Name Expression for the scope template (see Using Expressions in Scope Templates) on the List/Add DHCP Scope Template page, when you add a scope on the List/Add DHCP Scopes page, omit the name of the scope, but add its subnet and mask, then choose the scope template from the Template drop-down list. Clicking Add DHCP Scope creates a scope with a name synthesized from the scope name expression. If you do not set a scope name expression in the template and apply it to the scope without specifying a name for the scope, you get an error. (Note that Basic mode does not provide this functionality.)
-
After creating a named scope—On the Edit DHCP Scopes page, scroll to the bottom to find the Apply Template button. Choose a preconfigured template from the drop-down list, then click the button. Then click Save. (Be aware of the previous warning that the template attributes overwrite the existing ones of the scope.)
CLI Commands
To apply a template to the scope while creating the scope, use scope name create address mask [template=template-name] [attribute=value ...]. For example:
nrcmd> scope example-scope create 192.168.50.0 24 template=example-scope-template
To derive the scope name from the template during scope creation, use scope-template name apply-to { all | scope1 , scope2 ,...}. For example:
nrcmd> scope-template example-scope-template apply-to examplescope-1,examplescope-2
Cloning a Scope Template
In the CLI, you can also clone a scope template from an existing one by using scope-template clone-name create clone= template, and then make adjustments to the clone. For example:
nrcmd> scope-template cloned-template create clone=example-scope-template-1 ping-timeout=200