cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2153
Views
0
Helpful
3
Replies

Template Loop With Range Not Working

In advance of deploying DNAC I'm trying to figure out VTL, but can't get loops to work when using variables. This is on one of the reserved instances of DNAC on Devnet. I got the idea from this post by Adam Radford

Even when I try exactly what he does in the blog post, the simulation has zero output

 

#set ($stack_member_count = $stack_count)

#foreach($switch in [1..${stack_member_count}])
interface Ten${switch}/0/1
#uplink_interface
#end

 

What I'm trying to get working is this

 

#macro (access_interface)
switchport host
switchport access vlan $access_vlan
switchport voice vlan $voice_vlan
#end

$first_access_port
$last_access_port
$access_vlan
$voice_vlan

#foreach($port in [${first_access_port}..${last_access_port}])
int gig1/0/$port
#access_interface
#end

3 Replies 3

Preston Chilcote
Cisco Employee
Cisco Employee