Vous êtes sur la page 1sur 12

TP1 : VLAN

Objectifs :

 Créer une configuration de commutateur de base et la vérifier.


 Créer des VLANs par port.
 Nommer les VLANs et leur affecter plusieurs ports membres.
 Configurer le mode Trunk
 Configurer intervlan.

Introduction sur les VLANs :

Un VLAN permet de créer des domaines de diffusion (domaines de broadcast) gérés par
les commutateurs indépendamment de l’emplacement où se situent les noeuds, ce sont des
domaines de diffusion gérés logiquement
Les avantages des VLANs sont les suivants :
La réduction des messages de diffusion (notamment les requêtes ARP) limités à l'intérieur
d’un
VLAN. Ainsi les diffusions d'un serveur peuvent être limitées aux clients de ce serveur.
La création de groupes de travail indépendants de l'infrastructure physique ; possibilité de
déplacer la station sans changer de réseau virtuel.
L’augmentation de la sécurité par le contrôle des échanges inter-VLAN utilisant des
routeurs (filtrage possible du trafic échangé entre les VLANs).
Les méthodes de construction d’un Vlan doivent donc déterminer la façon dont le
commutateur va associer la trame à un Vlan. Usuellement on présente trois méthodes pour
créer des VLAN : les vlan par port (niveau 1), les Vlan par adresses MAC (niveau 2), les
Vlan par adresses IP (niveau 3) ainsi que des méthodes dérivées.
 Les Vlan par port (Vlan de niveau 1)
On affecte chaque port des commutateurs à un VLAN.
L’appartenance d’une trame à un VLAN est alors déterminée par la connexion de la carte
réseau à un port du commutateur.
Les ports sont donc affectés statiquement à un VLAN.
 Les Vlan par adresse MAC (Vlan de niveau 2)
On affecte chaque adresse MAC à un VLAN.
L’appartenance d’une trame à un VLAN est déterminée par son adresse MAC. En fait il
s’agit, à partir de l’association Mac/VLAN, d‘affecter manuellement ou dynamiquement
les ports des commutateurs à chacun des VLAN en fonction de l’adresse MAC de l’hôte
qui émet sur ce port.
 Les Vlan par adresse de Niveau 3 (VLAN de niveau 3)
On affecte une adresse de niveau 3 à un VLAN.
L’appartenance d’une trame à un VLAN est alors déterminée par l’adresse de niveau 3 ou
supérieur qu’elle contient (le commutateur doit donc accéder à ces informations).
En fait, il s’agit à partir de l’association adresse niveau 3/VLAN d‘affecter dynamiquement
les ports des commutateurs à chacun des VLAN.

1/2
Travail à faire

Scénario 1 :

Etape 1 : Tracer un schéma similaire à l’aide du simulateur Packet Tracer.

Avec :

Le switch choisi sera : le 2960


PC1 : 192.168.0.1/24 connecté sur le port FastEthernet 0/1
PC2 : 192.168.0.2/24 connecté sur le port FastEthernet 0/2
PC3 : 192.168.0.3/24 connecté sur le port FastEthernet 0/3
PC4 : 192.168.0.4/24 connecté sur le port FastEthernet 0/4

Étape 2 : Configurez les hôtes reliés au commutateur


Étape 3 : Vérifiez la connectivité

C:\>PING 192.168.0.2

Pinging 192.168.0.2 with 32 bytes of data:

Reply from 192.168.0.2: bytes=32 time=4ms TTL=128


Reply from 192.168.0.2: bytes=32 time<1ms TTL=128
Reply from 192.168.0.2: bytes=32 time<1ms TTL=128
Reply from 192.168.0.2: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.0.2:


Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 4ms, Average = 1ms

2/2
Étape 4 : Affichez les informations d’interface VLAN

SHOw VLan
- Quels ports appartiennent au VLAN par défaut ?

VLAN Name Status Ports


---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
Gig0/1, Gig0/2

Étape 5 : Créez et nommez deux VLAN


- VLAN 2 => Administration

Switch(config)#VLAN 2
Switch(config-vlan)#NAME ADMINISTRATION

- VLAN 3 => Stagiaires


Switch(config)#VLAN 3
- Switch(config-vlan)#NAME Stagiaires

Étape 6 : Affectez des ports au VLAN Administration

Switch(config)#INTerface Range FastEthernet 0/2-3


Switch(config-if-range)#swi
Switch(config-if-range)#switchport p
Switch(config-if-range)#switchport po
Switch(config-if-range)#switchport mo
Switch(config-if-range)#switchport mode a
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport ac
Switch(config-if-range)#switchport access v
Switch(config-if-range)#switchport access vlan 2
Switch(config-if-range)#ex

Étape 7 : Affichez les informations d’interface VLAN

Switch(config)#do show vlan

VLAN Name Status Ports


---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/4, Fa0/5, Fa0/6
Fa0/7, Fa0/8, Fa0/9, Fa0/10
Fa0/11, Fa0/12, Fa0/13, Fa0/14
Fa0/15, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21, Fa0/22
Fa0/23, Fa0/24, Gig0/1, Gig0/2
3/2
2 ADMINISTRATION active Fa0/2, Fa0/3
3 Stagiaires active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active

- Les ports 1 et 4 sont-ils affectés au VLAN 2?


- no
Étape 8 : Affectez des ports au VLAN Etudiants
Switch(config)#INTerface fastEthernet 0/1
Switch(config-if)#sw
Switch(config-if)#switchport mo
Switch(config-if)#switchport mode a
Switch(config-if)#switchport mode access
Switch(config-if)#sw
Switch(config-if)#switchport ac
Switch(config-if)#switchport access vla
Switch(config-if)#switchport access vlan 3
Switch(config-if)#ex
Switch(config)#INTerface fastEthernet 0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 3
Switch(config-if)#ex

Étape 9 : Affichez les informations d’interface VLAN

Switch(config)#do show vlan

VLAN Name Status Ports


---- -------------------------------- --------- -------------------------------
1 default active Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
Gig0/1, Gig0/2
2 ADMINISTRATION active Fa0/2, Fa0/3
3 Stagiaires active Fa0/1, Fa0/4
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
- Les ports 2 et 3 sont-ils affectés au VLAN 3?
- No

Étape 10 : Testez les VLAN


- La requête ping a-t-elle abouti ?
- no
- Pourquoi ?
- Deffirent vlan
- Envoyez une requête ping à l’hôte dans le port 0/4 à partir de l’hôte dans le port
0/1.
- La requête ping a-t-elle abouti ?
4/2
- oui
- Pourquoi ?
- Same vlan

Scénario 2 :

Etape 1 : Tracer un schéma similaire à l’aide du simulateur Packet Tracer.

Etape 1 : Configurer le filtrage par adresse mac sur le switch cisco


Etape 2 : Activer le mode port-security
Etape 3 : Choisir le mode de violation
Etape 4 : Ajouter manuellement les adresses mac
Etape 5 : vérifier le résultat

Switch(config)#INTerface FAstEthernet 0/2


Switch(config-if)#SWIT
Switch(config-if)#SWITchport MO
Switch(config-if)#SWITchport MOde A
Switch(config-if)#SWITchport MOde Access
Switch(config-if)#SWI
Switch(config-if)#SWItchport PO
Switch(config-if)#SWItchport POrt-security
Switch(config-if)#SWItchport POrt-security MA
Switch(config-if)#SWItchport POrt-security ma
Switch(config-if)#SWItchport POrt-security mac
Switch(config-if)#SWItchport POrt-security mac-address vio
Switch(config-if)#SWItchport POrt-security mac-address viola
Switch(config-if)#SWItchport POrt-security vi
Switch(config-if)#SWItchport POrt-security violation shu
Switch(config-if)#SWItchport POrt-security violation shutdown
Switch(config-if)#ex
Switch(config)#INTerface FAstEthernet 0/3
Switch(config-if)#SWItchport POrt-security
Command rejected: FastEthernet0/3 is a dynamic port.
5/2
Switch(config-if)#SWITchport MOde Access
Switch(config-if)#SWItchport POrt-security
Switch(config-if)#SWItchport POrt-security ma
Switch(config-if)#SWItchport POrt-security mac
Switch(config-if)#SWItchport POrt-security mac-address 00D0.BC37.29AC
Switch(config-if)#ex
Switch(config)#intr
Switch(config)#inter
Switch(config)#interface f
Switch(config)#interface fastEthernet 0/2
Switch(config-if)#SWItchport POrt-security mac-address 0001.9773.00C2
Switch(config-if)#ex
Switch(config)#ex
Switch#
%SYS-5-CONFIG_I: Configured from console by console

Switch#sho
Switch#show p
Switch#show po
Switch#show port-security
Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action
(Count) (Count) (Count)
--------------------------------------------------------------------
Fa0/2 1 1 0 Shutdown
Fa0/3 1 1 0 Shutdown
----------------------------------------------------------------------
Switch#show
Switch#show ma
Switch#show mac
Switch#show mac-a
Switch#show mac-address-table
Mac Address Table
-------------------------------------------

Vlan Mac Address Type Ports


---- ----------- -------- -----

1 0001.9773.00c2 STATIC Fa0/2


1 00d0.bc37.29ac STATIC Fa0/3
Switch#
%LINK-5-CHANGED: Interface FastEthernet0/4, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to up

6/2
Scénario 3 :

Etape 1 : Tracer un schéma similaire à l’aide du simulateur Packet Tracer.

Etape 2 : Créer les vlans sur les switches


Etape 3 : Attribuer les interfaces aux vlan
Etape 4 : Configurer les interfaces en mode access
Etape 5 : Configurer les deux switches en mode trunk
Étape 6 : Testez les VLAN

SWITCH 1

Switch>EN
Switch#CONF T
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#VTP MO
Switch(config)#VTP MOde SE
Device mode already VTP SERVER.
Switch(config)#VT
Switch(config)#VTp D
Switch(config)#VTp Domain AY
Changing VTP domain name from NULL to AY
Switch(config)#VTP PA
Switch(config)#VTP PAssword 123
Setting device VLAN database password to 123
Switch(config)#VLAN 10
Switch(config-vlan)#EX
Switch(config)#VLAN 20
Switch(config-vlan)#EX
Switch(config)#IN
Switch(config)#INterface F
7/2
Switch(config)#INterface FastEthernet 0/1
Switch(config-if)#SWI
Switch(config-if)#SWItchport P
Switch(config-if)#SWItchport PO
Switch(config-if)#SWItchport TRU
Switch(config-if)#SWItchport TRUnk AL
Switch(config-if)#SWItchport TRUnk ALlowed
% Incomplete command.
Switch(config-if)#SWItchport TRUnk ALlowed VLAN 10?
WORD
Switch(config-if)#SWItchport TRUnk ALlowed VLAN 10,20
Switch(config-if)#SWI
Switch(config-if)#SWItchport M
Switch(config-if)#SWItchport Mode T
Switch(config-if)#SWItchport Mode Trunk

Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to
down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Switch(config-if)#
Switch(config-if)#EX
Switch(config)#INT
Switch(config)#INTerface R
Switch(config)#INTerface Range F
Switch(config)#INTerface Range FastEthernet 0/4-5
Switch(config-if-range)#SWI
Switch(config-if-range)#SWItchport M
Switch(config-if-range)#SWItchport Mode A
Switch(config-if-range)#SWItchport Mode Access
Switch(config-if-range)#SW
Switch(config-if-range)#SWitchport A
Switch(config-if-range)#SWitchport Access VL
Switch(config-if-range)#SWitchport Access VLan 10
Switch(config-if-range)#EX
Switch(config)#INTerface Range FastEthernet 0/2-3
Switch(config-if-range)#SWItchport Mode Access
Switch(config-if-range)#SWitchport Access VLan 20
Switch(config-if-range)#EX

SWITCH 2

Switch>EN
Switch#CONF T
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#VTP DOMA
Switch(config)#VTP DOMAin N
Switch(config)#VTP DOMAin NA
Switch(config)#VTP DOMAin ?
WORD The ascii name for the VTP administrative domain.
Switch(config)#VTP DOMAin AY
8/2
Changing VTP domain name from NULL to AY
Switch(config)#VTP PA
Switch(config)#VTP PAssword 123
Setting device VLAN database password to 123
Switch(config)#VTP MODE
Switch(config)#VTP MODE CL
Switch(config)#VTP MODE CLient
Setting device to VTP CLIENT mode.
Switch(config)#DO SHOW VLAN

VLAN Name Status Ports


---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
Gig0/1, Gig0/2
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------

Remote SPAN VLANs


------------------------------------------------------------------------------

Primary Secondary Type Ports


------- --------- ----------------- ------------------------------------------
Switch(config)#
Switch(config)#
Switch(config)#
Switch(config)#
Switch(config)#%SPANTREE-2-RECV_PVID_ERR: Received 802.1Q BPDU on non trunk
FastEthernet0/1 VLAN1.

%SPANTREE-2-BLOCK_PVID_LOCAL: Blocking FastEthernet0/1 on VLAN0001.


Inconsistent port type.

Switch(config)#FA
Switch(config)#INT
Switch(config)#INTerface F
9/2
Switch(config)#INTerface FastEthernet 0/1
Switch(config-if)#SWO
Switch(config-if)#SWI
Switch(config-if)#SWItchport M
Switch(config-if)#SWItchport Mode A
Switch(config-if)#SWItchport Mode TU
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to
down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Switch(config-if)#SWItchport Mode TR
Switch(config-if)#SWItchport Mode TRunk
Switch(config-if)#EX
Switch(config)#DO SHOW VLAN

VLAN Name Status Ports


---- -------------------------------- --------- -------------------------------
1 default active Fa0/2, Fa0/3, Fa0/4, Fa0/5
Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Fa0/11, Fa0/12, Fa0/13
Fa0/14, Fa0/15, Fa0/16, Fa0/17
Fa0/18, Fa0/19, Fa0/20, Fa0/21
Fa0/22, Fa0/23, Fa0/24, Gig0/1
Gig0/2
10 VLAN0010 active
20 VLAN0020 active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
10 enet 100010 1500 - - - - - 0 0
20 enet 100020 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------

Remote SPAN VLANs


------------------------------------------------------------------------------

Primary Secondary Type Ports


------- --------- ----------------- ------------------------------------------
Switch(config)#
Switch(config)#INTerface FastEthernet 0/1
Switch(config-if)#SWI
Switch(config-if)#SWItchport T
10/
2
Switch(config-if)#SWItchport Trunk A
Switch(config-if)#SWItchport Trunk Allowed V
Switch(config-if)#SWItchport Trunk Allowed Vlan 10?
WORD
Switch(config-if)#SWItchport Trunk Allowed Vlan 10,20
Switch(config-if)#EX
Switch(config)#
Switch(config)#FA
Switch(config)#FAS
Switch(config)#IN
Switch(config)#INterface R
Switch(config)#INterface Range FA
Switch(config)#INterface Range FAstEthernet 0/2-3
Switch(config-if-range)#SWI
Switch(config-if-range)#SWItchport MO
Switch(config-if-range)#SWItchport MOde A
Switch(config-if-range)#SWItchport MOde Access
Switch(config-if-range)#SW
Switch(config-if-range)#SWitchport A
Switch(config-if-range)#SWitchport Access V
Switch(config-if-range)#SWitchport Access Vlan 10
Switch(config-if-range)#EX
Switch(config)#INterface Range FAstEthernet 0/4-5
Switch(config-if-range)#SWItchport MOde Access
Switch(config-if-range)#SWitchport Access Vlan 20
Switch(config-if-range)#EX

Scénario 4 :

Etape 1 : Tracer un schéma similaire à l’aide du simulateur Packet Tracer.

11/
2
Étape 2 : Créer les quatre vlans
Étape 3 : Affecter les ports en mode Access
Étape 4 : Affecter les ports en mode Trunk
Étape 5 : Configurer le routage inter vlan
Étape 6 : tester la connexion entres les différentes machines

12/
2

Vous aimerez peut-être aussi