In this problem, you are asked to develop a Jinja template to generate the configuration of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In this problem, you are asked to develop a Jinja template to generate the configuration of a Layer-3 switch according to the following specification: The input of the template is very simple, and it contains only two items: the number of VLANS in the network, and the name prefix for naming the VLANs. The input can look like the following: vlans_no: 16 name_prefix: AMERI This input indicates that we have 16 VLANs in the network and the names given to the VLANS should start with "AMERI" VLANS ids. The VLANs will be given ids of multiples of 10 and starting at 10. For example, if we have 16 VLANs, their IDs will be 10, 20, 30, ..., 160. VLANs names. The VLANs will be named by concatenating the name_prefix provided in the input file with the VLAN id, separated by a hyphen. In our example, the VLANs will be named: AMERI-10, AMERI-20, ..., AMERI-160. Each VLAN is assigned a /24 address range within the 192.168.0.0/16 network, and we need to create a virtual interface for each VLAN using the first usable ip address in the VLAN's address range. In our example, the ip addresses of the virtual interfaces will be 192.168.10.1, 192.168.20.1, ..., 192.168.160.1. We will not have more than 24 VLANs, so you do not need to worry about ip addresses going beyond 255 in the third octet. Each VLAN will be assigned a range of two physical access switchports. In our example, the vlans will be assigned access switchports like follows: vlan 10 vlan 20 vlan 160 interface range f0/1-2 interface range f0/3-4 interface range f0/31-32 Page 1 of 4 You must use a for loop in you template. You only need one for loop for this template. Refer to Slide 8 in the presentation 17 - Network Configuration Templating for the for-loop syntax in Jinja. Hint. In the examples we have in the slides, we use something like { for n in range (10) }: to loop from 0-9 (i.e., n starts at 0 and ends at 10-1). If you're familiar with Python, this is a similar behavior. If you want a loop that goes from 1-10 instead, you can use something like this: { for n in range (1, 11) @}. You can use the website https://j2live.tt/255.com/to test your template. Just like we did in the recorded presentation. Sample output. In the following, I am showing how the configuration of a single VLAN should look like. Basically, you should use the following as the basis of your template. You only need to add the for and replace the data with the appropriate variables from the input (i.e., you must use vlans_no and name_prefix in your template). As a hint for you, the data colored in blue must be replaced by or derived from variables. vlan 10 name AMERI-10 interface vlan 10 ip address 192.168.10.1 255.255.255.0 interface range f0/1-2 switchport access vlan 10 switchport mode access In the final output of your template, the above needs to be repeated for as many VLANs as we have set in the input file. In this problem, you are asked to develop a Jinja template to generate the configuration of a Layer-3 switch according to the following specification: The input of the template is very simple, and it contains only two items: the number of VLANS in the network, and the name prefix for naming the VLANs. The input can look like the following: vlans_no: 16 name_prefix: AMERI This input indicates that we have 16 VLANs in the network and the names given to the VLANS should start with "AMERI" VLANS ids. The VLANs will be given ids of multiples of 10 and starting at 10. For example, if we have 16 VLANs, their IDs will be 10, 20, 30, ..., 160. VLANs names. The VLANs will be named by concatenating the name_prefix provided in the input file with the VLAN id, separated by a hyphen. In our example, the VLANs will be named: AMERI-10, AMERI-20, ..., AMERI-160. Each VLAN is assigned a /24 address range within the 192.168.0.0/16 network, and we need to create a virtual interface for each VLAN using the first usable ip address in the VLAN's address range. In our example, the ip addresses of the virtual interfaces will be 192.168.10.1, 192.168.20.1, ..., 192.168.160.1. We will not have more than 24 VLANs, so you do not need to worry about ip addresses going beyond 255 in the third octet. Each VLAN will be assigned a range of two physical access switchports. In our example, the vlans will be assigned access switchports like follows: vlan 10 vlan 20 vlan 160 interface range f0/1-2 interface range f0/3-4 interface range f0/31-32 Page 1 of 4 You must use a for loop in you template. You only need one for loop for this template. Refer to Slide 8 in the presentation 17 - Network Configuration Templating for the for-loop syntax in Jinja. Hint. In the examples we have in the slides, we use something like { for n in range (10) }: to loop from 0-9 (i.e., n starts at 0 and ends at 10-1). If you're familiar with Python, this is a similar behavior. If you want a loop that goes from 1-10 instead, you can use something like this: { for n in range (1, 11) @}. You can use the website https://j2live.tt/255.com/to test your template. Just like we did in the recorded presentation. Sample output. In the following, I am showing how the configuration of a single VLAN should look like. Basically, you should use the following as the basis of your template. You only need to add the for and replace the data with the appropriate variables from the input (i.e., you must use vlans_no and name_prefix in your template). As a hint for you, the data colored in blue must be replaced by or derived from variables. vlan 10 name AMERI-10 interface vlan 10 ip address 192.168.10.1 255.255.255.0 interface range f0/1-2 switchport access vlan 10 switchport mode access In the final output of your template, the above needs to be repeated for as many VLANs as we have set in the input file.
Expert Answer:
Related Book For
Statistics For Business And Economics
ISBN: 9780132745659
8th Edition
Authors: Paul Newbold, William Carlson, Betty Thorne
Posted Date:
Students also viewed these computer network questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
Route Canal Shipping Company has the following schedule for aging of accounts receivable: AGE OF RECEIVABLES APRIL 30, 2001 a. Fill in column (4) for each month. b. If the firm had $1,440,000 in...
-
Suppose that a uniform magnetic field is everywhere perpendicular to this page. The field points directly upward toward you. A circular path is drawn on the page. Use Ampre's law to show that there...
-
Izabella had a 20-year Radisson Hotel franchise. The agreement said Izabella may not perform any construction or renovation without Radissons approval, except for routine maintenance and repair....
-
War by Parker is an eyewear company that sells prescription glasses, sunglasses, contact lenses, and related services. Founded in 2010 as an online retailer, the firm now sells online and through 223...
-
1. How many minutes, on average, does it take for a first edition patron to get the requested book from time of entry into the library? (State all assumptions and show the calculations.) 2. How many...
-
G is an individual GST registrant that files GST returns annually. At the beginning of year 20XX, G incorporated their sole proprietorship into G Inc., a wholly owned subsidiary of G, and registered...
-
Isorait Co is a company which installs kitchens and bathrooms to customer specifications. It is planning to invest KShs. 4,000,000 in a new facility to convert vans and trucks into motorhomes. Each...
-
Jane has just heard about Nike Inc. and how investors are buying up their shares which is currently being sold at $235.75 per share. She found out that last year they paid dividends of $1.44 and they...
-
Given two bond portfolios with the same duration, but different convexities, portfolio managers must choose the one with higher convexity. Do you agree? Why?
-
Draw a flowchart for a program that calculates speed using the following formula. The program must ask the user to input distance travelled in kilometers and time travelled in hours. Then, it will...
-
If I need $22,000 and a bank offers me a loan charging 5% interest annually, but the loan comes with an 11% compensating balance, how big of a loan will I need?
-
Consider a Naive Bayes classifier for a binary classification task in a two-dimensional feature space with P(x|C) ~ G(,), P(xC) G (2.2) and P(C) = P(C) = 1, where x = is a sample observation, ; is...
-
provide answers to all questions (a) What are the main criteria to be considered in the design of a line drawing algorithm for a raster graphics display? [2 marks] (b) Describe an algorithm to fill a...
-
Are some diet programs easier to stick to than others? Researchers randomly assigned overweight people to one of four popular diets, and they recorded how many in each diet successfully completed the...
-
Determine which of the following limits exist. Compute the limits that exist. lim x-0 1- + 3x X
-
Calculate the mean dollar amount and the standard deviation for the dollar amounts charged to a Visa account at Florin's Flower Shop. Data are stored in the data file Florin.
-
The ages of a group of executives attending a convention are uniformly distributed between 35 and 65 years. If the random variable X denotes ages in years, the probability density function is as...
-
A consumer goods company has been studying the effect of advertising on total profits. As part of this study, data on advertising expenditures (1,000s) and total sales (1,000s) were collected for a...
-
A wind turbine works by slowing the air that passes its blades and converting much of the extracted kinetic energy to electric energy. A large wind turbine has 45-m-radius blades. In typical...
-
You are pulling a child in a wagon. The rope handle is inclined upward at a 60 angle. The tension in the handle is 20 N. How much work do you do if you pull the wagon 100 m at a constant speed?
-
A typical muscle fiber is 2.0 cm long and has a cross-section area of 3.1 10-9 m 2 . When the muscle fiber is stimulated, it pulls with a force of 1.2 mN. What is the work done by the muscle fiber...
Study smarter with the SolutionInn App