-
Notifications
You must be signed in to change notification settings - Fork 0
/
nxos.interface_template.j2
60 lines (59 loc) · 1.63 KB
/
nxos.interface_template.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
interface {{if_name}}
{%- if if_use|lower == 'uplink' %}
description trunk to {{if_info2}}
switchport mode trunk
switchport nonegotiate
spanning-tree portfast disable
spanning-tree bpduguard disable
spanning-tree link-type point-to-point
storm-control broadcast level 0.01
storm-control action trap
switchport trunk allowed vlan {{if_info1}}
{% elif if_use|lower == 'server' %}
description {{description}}
speed 1000
duplex full
switchport mode access
switchport access vlan {{if_info1}}
switchport nonegotiate
no cdp enable
no shutdown
{% elif if_use|lower == 'user' %}
description {{description}}
switchport mode access
switchport access vlan {{if_info1}}
switchport nonegotiate
no cdp enable
switchport port-security
switchport port-security max 1
{%- if if_info2 %}
switchport port-security mac {{if_info2}}
switchport port-security aging type absolute
{%- else %}
switchport port-security aging time 1
switchport port-security aging type inactivity
{%- endif %}
switchport port-security violation restrict
storm-control broadcast level 0.01
storm-control action trap
no logging event link-status
no snmp trap link-status
no shutdown
{% elif if_use|lower == 'unused' %}
description {{description}}
switchport mode access
switchport access vlan 999
switchport nonegotiate
no cdp enable
switchport port-security
switchport port-security max 1
switchport port-security aging time 1
switchport port-security violation restrict
switchport port-security aging type inactivity
storm-control broadcast level 0.01
storm-control action trap
no logging event link-status
no snmp trap link-status
shutdown
{% endif -%}
!