eNSP - VLAN (access, trunk and hybrid ports)

VLAN practice...

topology:

Vlan 10 - 192.168.10.0/24
Vlan 20 - 192.168.20.0/24



1 - Create Vlans:

[S1] vlan batch 10 20 

note: vlans can be created as well with the command "vlan [id]". Use the command "display Vlan" to see vlan DataBase.

2 - Assign ports to the Vlans:

[S1] interface g0/0/1
[S1-GigabitEthernet0/0/1] port link-type access
[S1-GigabitEthernet0/0/1] port default vlan 10
[S1-GigabitEthernet0/0/1] interface g0/0/2
[S1-GigabitEthernet0/0/2] port link-type access
[S1-GigabitEthernet0/0/2] port default vlan 20
[S1-GigabitEthernet0/0/2] quit

3 - Assign trunk port:

[S1] interface g0/0/24
[S1-GigabitEthernet0/0/24] port link-type trunk
[S1-GigabitEthernet0/0/24] port trunk allow-pass vlan all
[S1-GigabitEthernet0/0/24] quit

4 - Configure S2:

[S2] vlan batch 10 20 
[S2] interface g0/0/1
[S2-GigabitEthernet0/0/1] port link-type access
[S2-GigabitEthernet0/0/1] port default vlan 20
[S2-GigabitEthernet0/0/1] interface g0/0/2
[S2-GigabitEthernet0/0/2] port link-type access
[S2-GigabitEthernet0/0/2] port default vlan 10
[S2-GigabitEthernet0/0/2] interface g0/0/24
[S2-GigabitEthernet0/0/24] port link-type trunk
[S2-GigabitEthernet0/0/24] port trunk allow-pass vlan all
[S2-GigabitEthernet0/0/24] quit

5 - Assign ip addresses to hosts:

client 1 - 192.168.10.100 255.255.255.0
client 2 - 192.168.20.100 255.255.255.0
client 3 - 192.168.10.101 255.255.255.0
client 4 - 192.168.20.101 255.255.255.0

Check connectivity by pinging hosts within the same Vlan.

6 - Hybrid ports:

Hybrid ports can operate as access ports and/or trunk ports, they are the default port type on Huawei switches.



This scenario is to simulate an end device that as the ability of tagging vlan packets. The ip address scheme is the same as in the previous scenario.

1 - Create Vlans on both switches:

[S1] vlan batch 10 20

[S2] vlan batch 10 20

2 - Configure interfaces between switches:

[S1] interface g0/0/1
[S1-GigabitEthernet0/0/1] port link-type hybrid
[S1-GigabitEthernet0/0/1] port hybrid tagged vlan 10 20


[S2] interface g0/0/1
[S2-GigabitEthernet0/0/1] port link-type hybrid
[S2-GigabitEthernet0/0/1] port hybrid tagged vlan 10 20

3 - Configure interfaces that connect to end devices:


[S1] interface g0/0/1
[S1-GigabitEthernet0/0/1] port link-type hybrid
[S1-GigabitEthernet0/0/1] port hybrid tagged vlan 20
[S1-GigabitEthernet0/0/1] port hybrid untagged vlan 10
[S1-GigabitEthernet0/0/1] port hybrid pvid vlan 10


[S2] interface g0/0/1
[S2-GigabitEthernet0/0/1] port link-type hybrid
[S2-GigabitEthernet0/0/1] port hybrid tagged vlan 20
[S2-GigabitEthernet0/0/1] port hybrid untagged vlan 10
[S2-GigabitEthernet0/0/1] port hybrid pvid vlan 10

Check connectivity by pinging hosts within the same Vlan. All hosts are in Vlan 10 regardless of the ip address. To test Vlan 20, configure the settings of client 2.

Go to settings > udpPacket



Make sure that the destination MAC and IP are the same as Client 4, the Vlan ID is set to 20, click "Send". Go to client 4, right click and select capture > Ethernet 0/0/1. Wireshark will start. 



WireShark is showing that the udp packets are being sent trough Vlan 20, this illustrate the scenario where two end devices connect to the same interface but are in different Vlans.


No comments:

Post a Comment