# Configuration des VLAN

<p class="callout info">Virtual Local Area Network</p>

##### Augmenter le nombre max de vlan

```
Procurve switch 2650(config)# max-vlan 100
Command will take effect after saving configuration and reboot
```

<p class="callout warning">Par défaut, le nombre max de vlan est de 8</p>

##### Création d'un VLAN

```
Procurve switch 2650(config)# vlan 100 name voix
Procurve switch 2650(config)# vlan 101 name data
Procurve switch 2650(config)# vlan 102 name wifi
```

##### Suppression d'un VLAN

```
Procurve switch 2650(config)# no vlan 102
```

##### Ajouter un port non taggué à un VLAN

```
Procurve switch 2650(config)# vlan 100
Procurve switch 2650(vlan-100)# untagged ethernet 1
Procurve switch 2650(vlan-100)# untagged ethernet 10-12
```

##### Ajouter un port taggué à un VLAN

```
Procurve switch 2650(config)# vlan 101
Procurve switch 2650(vlan-101)# tagged ethernet 2
Procurve switch 2650(vlan-101)# tagged ethernet 20-22
```

##### Assigner une adresse IP à un VLAN

```
Procurve switch 2650(config)# vlan 1
Procurve switch 2650(vlan-1)# ip address 192.168.1.100 255.255.255.0
```

##### Configurer un port en mode mixte

```
Procurve switch 2650(config)# vlan 100
Procurve switch 2650(vlan-100)# tagged ethernet 30
Procurve switch 2650(vlan-100)# exit
Procurve switch 2650(config)# vlan 101
Procurve switch 2650(vlan-101)# untagged ethernet 30
```

#### Configuration en mode Trunk

```
ProCurve Switch 2650(config)# vlan 100
ProCurve Switch 2650(vlan-100)# tagged ethernet 48
ProCurve Switch 2650(vlan-100)# exit
ProCurve Switch 2650(config)# vlan 101
ProCurve Switch 2650(vlan-101)# tagged ethernet 48
ProCurve Switch 2650(vlan-100)# exit
ProCurve Switch 2650(config)# vlan 102
ProCurve Switch 2650(vlan-101)# tagged ethernet 48
ProCurve Switch 2650(vlan-101)# exit
```

<p class="callout info">Tagger tous les VLAN sur le même port</p>

##### Vérification

```
Procurve switch 2650# show vlan

 Status and Counters - VLAN Information
 
  Maximum VLANs to support : 100
  Primary VLAN : DEFAULT_VLAN
  Management VLAN : 
  
  802.1Q VLAN ID	NAME			Status		Voice
  --------------    ----------  	----------  ------
  1					DEFAULT_VLAN	Port_based	No
  100				voix			Port_based	No
  101				data			Port_based	No
```

```
ProCurve Switch 2650# show vlan ports Ethernet 48

 Status and Counters - VLAN Information - for ports 48

  802.1Q VLAN ID Name         Status       Voice
  -------------- ------------ ------------ -----
  1              DEFAULT_VLAN Port-based   No
  100            data         Port-based   No
  101            voix         Port-based   No
```