/* .CHANGE_TEMPLATE_DESCRIPTION Create new Customer with 1 VRF on PEs .PLATFORM_DESCRIPTION Juniper JUNOS .PARAMETER_LABEL @ContextNode NCM Node .PARAMETER_DESCRIPTION @ContextNode The node the template will operate on. All templates require this by default. The target node is selected during the first part of the wizard so it will not be available for selection when defining values of variables. .PARAMETER_LABEL @custName Customer .PARAMETER_DESCRIPTION @custName Customer short name for VRF .PARAMETER_LABEL @cid Full cid .PARAMETER_DESCRIPTION @cid Full Customer ID - 4 digits .PARAMETER_LABEL @scid Short cid .PARAMETER_DESCRIPTION @scid Short Customer ID just for LAB Needed to build customer host network .PARAMETER_LABEL @swfwip Switch to Firewall IP .PARAMETER_DESCRIPTION @swfwip IP on switch for P2P to firewall including / prefix Part of the 10.200.x.x/17 block Switch is always last usable IP in /29 */ script CreateNewCustomer( NCM.Nodes @ContextNode, string @custName, string @cid, string @scid, string @swfwip ) { //Enter config mode CLI { configure } //Define variables for creating interfaces { string @loopback @loopback = '10.201.' @loopback = @loopback + @ContextNode.SiteID + '.' @loopback = @loopback + @ContextNode.PEID } { string @desc @desc = '"Customer' + ' ' @desc = @desc + @custName + '"' } //Create Interfaces CLI { set interfaces lo0 unit @cid description @desc set interfaces lo0 unit @cid family inet address @loopback set interfaces ge-0/0/7 unit @cid vlan-id @cid set interfaces ge-0/0/7 unit @cid family inet address @swfwip } //Define variables for creating routing instance { string @subinterface @subinterface = '.' + @cid } { string @rd @rd = ':' + @cid } { string @vrftarget @vrftarget = 'target:65000:' + @cid } //Create routing instance CLI { set routing-instance @custName instance-type vrf set routing-instance @custName interface ge-0/0/7@subinterface set routing-instance @custName interface lo0@subinterface set routing-instance @custName route-distinguisher 65000@rd set routing-instance @custName vrf-target import @vrftarget set routing-instance @custName vrf-target export @vrftarget set routing-instance @custName vrf-table-label set routing-instance @custName routing-options router-id @loopback set routing-instance @custName routing-options autonomous-system 65000 set routing-instance @custName routing-options autonomous-system independent-domain } //Commit config and quit CLI { commit and-quit } } |