Ajout TP-02
This commit is contained in:
22
TP-02/templates/vlan_switch.j2
Normal file
22
TP-02/templates/vlan_switch.j2
Normal file
@@ -0,0 +1,22 @@
|
||||
hostname {{ hostname }}
|
||||
|
||||
! Configuration des interfaces
|
||||
{% for interface in interfaces %}
|
||||
interface {{ interface.name }}
|
||||
description {{ interface.description }}
|
||||
{% if interface.mode == "access" %}
|
||||
switchport mode access
|
||||
switchport access vlan {{ interface.vlan_id }}
|
||||
{% elif interface.mode == "trunk" %}
|
||||
switchport mode trunk
|
||||
switchport trunk allowed vlan add {{ interface.vlan_id }}
|
||||
{% endif %}
|
||||
no shutdown
|
||||
{% endfor %}
|
||||
{% if management is defined %}
|
||||
! Configuration de l'IP de management
|
||||
interface vlan {{ management.vlan }}
|
||||
ip address {{ management.ip_address }} {{ management.subnet }}
|
||||
no shutdown
|
||||
{% endif %}
|
||||
end
|
||||
Reference in New Issue
Block a user