hp_switchs.py 5.93 KB
Newer Older
1 2
# -*- mode: python; coding: utf-8 -*-

3 4 5 6 7 8 9
"""
Configuration pour les scripts travaillant sur des switches.
"""

## Fonctionnalités des switches
ALL_FEATURES = [
    'POE', 'DHCP_SNOOPING', 'IPv6_MGMT', 'RA_GUARD',
10 11
    'MLD_SNOOPING', 'SNTP_NEW_SYNTAX', 'GIGABIT', 'OOBM',
    'FILTER_MDNS', 'RADIUS_DAE', 'DHCPv6_SNOOPING', 'IGMP_SNOOPING',
12
    'ARP_PROTECT', 'IPv6_LOGGING',
13
]
14 15 16 17

# Support du PoE(+)
POE = "PoE"

18 19 20
# Support de l'IGMP Snooping
IGMP_SNOOPING = "IGMP Snooping"

21 22 23
# Support du DHCP Snooping
DHCP_SNOOPING = "DHCP Snooping"

24 25
# Support du DHCPv6 Snooping
DHCPv6_SNOOPING = "DHCPv6 Snooping"
26

Gabriel Detraz's avatar
Gabriel Detraz committed
27 28 29
#Support ARP protect
ARP_PROTECT = "Arp Protect"

30 31 32
# Support de RA Guard
RA_GUARD = "RA Guard"

33 34 35
# Management en IPv6
IPv6_MGMT = "IPv6 Management"

36 37 38
# Logs over ipv6
IPv6_LOGGING = "Ipv6 logging"

39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
# Support du MLD snooping
MLD_SNOOPING = "MLD Snooping"

# Syntaxe de la configuration SNTP
SNTP_NEW_SYNTAX = "SNTP New Syntax"

# Ports Gigabit uniquement
GIGABIT = "Gigabit ports"

# Out-Of-Bandwidth Management
OOBM = "Out-Of-Bandwidth Management"

# Filtrage des trames mDNS
FILTER_MDNS = "mDNS filtering"

54 55 56
# Extensions dynamiques RADIUS
RADIUS_DAE = "RADIUS Dynamic Authorization Extensions"

57 58 59 60 61 62 63 64 65 66 67 68 69
## Configuration des différents modèles de switches
## Chaque référence de switch est représenté par un dictionnaire
## répertoriant :
##      - Le modèle du switch (ex. HP 2530)
##      - La version du firmware (ex. YA.16.04.0008)
##      - La liste des fonctionnalités supportées par le switch
##      - Une liste des ports (Q)SFP(+) du switch, le cas échéant
##      - Une liste des modules qui le constituent, le cas échéant.

HP_PROCURVE_MAP = {
    "J4899" : {
        'model' : "HP 2650",
        'firmware' : "H.10.119",
70
        'features' : [IGMP_SNOOPING, DHCP_SNOOPING],
71 72 73 74
    },
    "J4900" : {
        'model' : "HP 2626",
        'firmware' : "H.10.119",
75
        'features' : [IGMP_SNOOPING, DHCP_SNOOPING],
76 77 78
    },
    "J9021" : {
        'model' : "HP 2810",
Gabriel Detraz's avatar
Gabriel Detraz committed
79
        'firmware' : "N.11.78",
80 81 82 83
        'features' : [GIGABIT],
    },
    "J9085" : {
        'model' : "HP 2610",
Gabriel Detraz's avatar
Gabriel Detraz committed
84
        'firmware' : "R.11.121",
Gabriel Detraz's avatar
Gabriel Detraz committed
85
        'features' : [IGMP_SNOOPING, DHCP_SNOOPING, ARP_PROTECT],
86
        'sfp' : range(27, 29),
87 88 89
    },
    "J9088" : {
        'model' : "HP 2610",
Gabriel Detraz's avatar
Gabriel Detraz committed
90
        'firmware' : "R.11.121",
Gabriel Detraz's avatar
Gabriel Detraz committed
91
        'features' : [IGMP_SNOOPING, DHCP_SNOOPING, ARP_PROTECT],
92
        'sfp' : range(51, 53),
93 94 95
    },
    "J9145" : {
        'model' : "HP 2910al",
Gabriel Detraz's avatar
Gabriel Detraz committed
96
        'firmware' : "W.15.14.0016",
97 98
        'features' : [
            IPv6_MGMT, IGMP_SNOOPING, DHCP_SNOOPING, RA_GUARD,
99
            GIGABIT, SNTP_NEW_SYNTAX, RADIUS_DAE,
Gabriel Detraz's avatar
Gabriel Detraz committed
100
            FILTER_MDNS, ARP_PROTECT,
101
        ],
102
        'modules' : ["J9145A"],
103
        'sfp' : range(21, 25),
104 105 106
    },
    "J9623" : {
        'model' : "HP 2620",
Gabriel Detraz's avatar
Gabriel Detraz committed
107
        'firmware' : "RA.16.04.0009",
108 109 110
        'features' : [
            IPv6_MGMT, DHCP_SNOOPING, DHCPv6_SNOOPING, RA_GUARD,
            MLD_SNOOPING, IGMP_SNOOPING, SNTP_NEW_SYNTAX, RADIUS_DAE,
111
            FILTER_MDNS, ARP_PROTECT, IPv6_LOGGING,
112
        ],
113 114 115
    },
    "J9624" : {
        'model' : "HP 2620",
Gabriel Detraz's avatar
Gabriel Detraz committed
116
        'firmware' : "RA.16.04.0009",
117 118 119
        'features' : [
            IPv6_MGMT, POE, DHCP_SNOOPING, DHCPv6_SNOOPING,
            RA_GUARD, MLD_SNOOPING, IGMP_SNOOPING, SNTP_NEW_SYNTAX,
120
            RADIUS_DAE, FILTER_MDNS, ARP_PROTECT, IPv6_LOGGING,
121 122 123
        ],
        'sfp' : range(27, 29),
        'poe' : range(1, 13),
124 125 126
    },
    "J9626" : {
        'model' : "HP 2620",
Gabriel Detraz's avatar
Gabriel Detraz committed
127
        'firmware' : "RA.16.04.0009",
128 129 130
        'features' : [
            IPv6_MGMT, DHCP_SNOOPING, DHCPv6_SNOOPING, RA_GUARD,
            MLD_SNOOPING, IGMP_SNOOPING, SNTP_NEW_SYNTAX, RADIUS_DAE,
131
            FILTER_MDNS, ARP_PROTECT, IPv6_LOGGING,
132
        ],
133 134 135
    },
    "J9727" : {
        'model' : "HP 2920",
Gabriel Detraz's avatar
Gabriel Detraz committed
136
        'firmware' : "WB.16.05.0003",
137 138
        'features' : [
            IPv6_MGMT, POE, DHCP_SNOOPING, DHCPv6_SNOOPING,
139
            RA_GUARD, MLD_SNOOPING, IGMP_SNOOPING, SNTP_NEW_SYNTAX,
140
            GIGABIT, OOBM, RADIUS_DAE, FILTER_MDNS, ARP_PROTECT, IPv6_LOGGING,
141
        ],
142
        'modules' : ["J9727A"],
143 144
        'sfp' : range(21, 25),
        'poe' : range(1, 25),
145
    },
146 147
    "J9772" : {
        'model' : "HP 2530",
Gabriel Detraz's avatar
Gabriel Detraz committed
148
        'firmware' : "YA.16.05.0003",
149 150
        'features' : [
            IPv6_MGMT, POE, DHCP_SNOOPING, DHCPv6_SNOOPING,
151
            RA_GUARD, MLD_SNOOPING, IGMP_SNOOPING, SNTP_NEW_SYNTAX,
152
            GIGABIT, RADIUS_DAE, FILTER_MDNS, ARP_PROTECT, IPv6_LOGGING,
153 154 155 156
        ],
        'sfp' : range(49, 53),
        'poe' : range(1, 53),
    },
157 158
    "J9773" : {
        'model' : "HP 2530",
Gabriel Detraz's avatar
Gabriel Detraz committed
159
        'firmware' : "YA.16.05.0003",
160 161
        'features' : [
            IPv6_MGMT, POE, DHCP_SNOOPING, DHCPv6_SNOOPING,
162
            RA_GUARD, MLD_SNOOPING, IGMP_SNOOPING, SNTP_NEW_SYNTAX,
163 164
            GIGABIT, RADIUS_DAE, FILTER_MDNS, ARP_PROTECT, IPv6_LOGGING,

165 166 167
        ],
        'sfp' : range(25, 29),
        'poe' : range(1, 25),
168 169 170
    },
    "J9775" : {
        'model' : "HP 2530",
Gabriel Detraz's avatar
Gabriel Detraz committed
171
        'firmware' : "YA.16.05.0003",
172 173
        'features' : [
            IPv6_MGMT, DHCP_SNOOPING, DHCPv6_SNOOPING, RA_GUARD,
174
            MLD_SNOOPING, IGMP_SNOOPING, SNTP_NEW_SYNTAX, GIGABIT,
175
            RADIUS_DAE, FILTER_MDNS, ARP_PROTECT, IPv6_LOGGING,
176 177
        ],
        'sfp' : range(49, 53),
178 179 180
    },
    "J9776" : {
        'model' : "HP 2530",
Gabriel Detraz's avatar
Gabriel Detraz committed
181
        'firmware' : "YA.16.05.0003",
182 183
        'features' : [
            IPv6_MGMT, DHCP_SNOOPING, DHCPv6_SNOOPING, RA_GUARD,
184
            MLD_SNOOPING, IGMP_SNOOPING, SNTP_NEW_SYNTAX, GIGABIT,
185
            RADIUS_DAE, FILTER_MDNS, ARP_PROTECT, IPv6_LOGGING,
186 187
        ],
        'sfp' : range(25, 29),
188 189 190
    },
    "J9777" : {
        'model' : "HP 2530",
Gabriel Detraz's avatar
Gabriel Detraz committed
191
        'firmware' : "YA.16.05.0003",
192 193
        'features' : [
            IPv6_MGMT, DHCP_SNOOPING, DHCPv6_SNOOPING, RA_GUARD,
194
            MLD_SNOOPING, IGMP_SNOOPING, SNTP_NEW_SYNTAX, GIGABIT,
195
            RADIUS_DAE, FILTER_MDNS, ARP_PROTECT, IPv6_LOGGING,
196 197
        ],
        'sfp' : range(9, 11),
198 199 200 201
    },
}

ALL_MODELS = list({switch["model"] for switch in HP_PROCURVE_MAP.values()})