Ajout Config ESW3

This commit is contained in:
2025-11-13 09:45:43 +01:00
parent ef4dffe5ef
commit 2389e11ed5
3 changed files with 51 additions and 3 deletions

23
TP-02/data/vlan_ESW3.json Normal file
View File

@@ -0,0 +1,23 @@
{
"hostname": "ESW3",
"interfaces": [
{
"name": "f1/1",
"mode": "access",
"vlan_id": "10",
"description": "Connexion vers le VLAN 10"
},
{
"name": "f1/2",
"mode": "access",
"vlan_id": "20",
"description": "Connexion vers le VLAN 20"
},
{
"name": "f1/0",
"mode": "trunk",
"vlan_id": "10,20",
"description": "Connexion vers le routeur R2"
}
]
}

19
TP-02/data/vlan_R03.json Normal file
View File

@@ -0,0 +1,19 @@
{
"hostname": "R3",
"interfaces": [
{
"name": "g0/0.10",
"description": "Gateway pour le reseau 172.16.50.0/24",
"ip": "172.16.50.254",
"mask": "255.255.255.0",
"vlan_id": "10"
},
{
"name": "g0/0.20",
"description": "Gateway pour le reseau 172.16.60.0/24",
"ip": "172.16.60.254",
"mask": "255.255.255.0",
"vlan_id": "20"
}
]
}

View File

@@ -41,6 +41,12 @@ def create_vlan_config_cpe_paris():
"""
Must return two values : router config and the switch config
"""
esw3_data = load_json_data_from_file(file_path='data/vlan_ESW3.json')
esw3_config = render_network_config(template_name='vlan_switch.j2', data=esw3_data)
R3_data = load_json_data_from_file(file_path='data/vlan_R03.json')
R3_config = render_network_config(template_name='vlan_router.j2', data=R3_data)
return R3_config,esw3_config
pass
@@ -52,6 +58,6 @@ if __name__ == "__main__":
save_built_config('config/vlan_R02.conf', r02_config)
save_built_config('config/vlan_ESW2.conf', esw2_config)
# r03_config, esw3_config = create_vlan_config_cpe_paris()
# save_built_config('config/vlan_R03.conf', r03_config)
# save_built_config('config/vlan_ESW3.conf', esw3_config)
r03_config, esw3_config = create_vlan_config_cpe_paris()
save_built_config('config/vlan_R03.conf', r03_config)
save_built_config('config/vlan_ESW3.conf', esw3_config)