当前位置:网站首页>Serial of H3CNE experiment column - VLAN configuration experiment, access and trunk

Serial of H3CNE experiment column - VLAN configuration experiment, access and trunk

2022-06-24 16:26:00 Network technology alliance station

What I bring to you today is h3cne The most basic in the experiment vlan experiment , Please look at the catalogue :

One 、 Experiment contents and objectives

Complete this experiment , You should be able to :

  • master VLAN How it works
  • master Access Link ports and Trunk Basic configuration of link ports

Two 、 Experimental networking diagram

VLAN Experimental environment diagram

3、 ... and 、 Experimental process

3.1 Experiment task one : To configure Access Link port

The task of this experiment is to configure Access Link port PC In a different place VLAN, Isolation PC between The interview of , So that we can deepen our understanding of Access Link port understanding .

Step one : Establish a physical connection

according to VLAN Connect the experimental environment diagram , Check the software version and configuration information of the equipment , Ensure that the software version of each device meets the requirements , All configurations are in the initial state . If the configuration does not meet the requirements , Please erase the configuration file in the device in user mode , Then restart the device to initialize the system with default configuration parameters .

The above steps may use the following commands :

<SWA> display version
<SWA> reset saved-configuration
<SWA> reboot
Step two : Observe the default VLAN

Check on the switch VLAN, As shown below :

[SWA]display vlan
The following VLANs exist:
1(default)
[SWA]display vlan 1
VLAN ID: 1
VLAN Type: static
Route Interface: not configured
Description: VLAN 0001
Tagged Ports: none
Untagged Ports:
GigabitEthernet1/0/1 GigabitEthernet1/0/2
GigabitEthernet1/0/3
GigabitEthernet1/0/4 GigabitEthernet1/0/5
GigabitEthernet1/0/6
GigabitEthernet1/0/7 GigabitEthernet1/0/8
GigabitEthernet1/0/9
GigabitEthernet1/0/10 GigabitEthernet1/0/11
GigabitEthernet1/0/12
GigabitEthernet1/0/13 GigabitEthernet1/0/14
GigabitEthernet1/0/15
GigabitEthernet1/0/16 GigabitEthernet1/0/17
GigabitEthernet1/0/18
GigabitEthernet1/0/19 GigabitEthernet1/0/20
GigabitEthernet1/0/21
GigabitEthernet1/0/22 GigabitEthernet1/0/23
GigabitEthernet1/0/24
GigabitGigabitEthernet1/1/1 GigabitGigabitEthernet1/1/2
GigabitGigabitEthernet1/1/3
GigabitGigabitEthernet1/1/4
[SWA]display interface GigabitEthernet 1/0/1
……
PVID: 1
Mdi type: auto
Port link-type: access
Tagged VLAN ID : none
Untagged VLAN ID : 1
Port priority: 0
……

From the above output , The default on the switch VLAN yes VLAN 1, All ports are in VLAN 1 in ; Port of PVID yes 1, And is Access Link port type .

Step three : To configure VLAN And add ports

Respectively in SWA and SWB To create a VLAN 2, And will PCA and PCC Connected port GigabitEthernet1/0/1 Add to VLAN 2 in .

To configure SWA:

[SWA]vlan 2
[SWA-vlan2]port GigabitEthernet 1/0/1

To configure SWB:

[SWB]vlan 2
[SWB-vlan2]port GigabitEthernet 1/0/1

View information about... On the switch VLAN 2 Information about , As shown below :

[SWA]display vlan
The following VLANs exist:
1(default), 2
[SWA]display vlan 2
VLAN ID: 2
VLAN type: Static
Route interface: Not configured
Description: VLAN 0002
Name: VLAN 0002
Tagged Ports: none
Untagged Ports:
GigabitEthernet1/0/1
[SWB]display vlan
The following VLANs exist:
1(default), 2
[SWB]display vlan 2
VLAN ID: 2
VLAN type: Static
Route interface: Not configured
Description: VLAN 0002
Name: VLAN 0002
Tagged ports: None
Untagged Ports:
GigabitEthernet1/0/1
Step four : test VLAN The isolation between them

We are PC On the configuration IP Address , adopt Ping Command to test in different VLAN Between the PC Can we communicate .

IP Address list :

Equipment name

IP Address

gateway

PCA

172.16.0.1/24

--

PCB

172.16.0.2/24

--

PCC

172.16.0.3/24

--

PCD

172.16.0.4/24

--

As shown in the above table PC On the configuration IP Address .

When the configuration is complete , stay PCA On the use of Ping Command to test to other PC The interoperability of . The result should be PCA And PCB Can't communicate with each other ,PCC and PCD Can't communicate with each other . Prove different VLAN We can't communicate with each other , Connected to the same switch PC Isolated .

3.2 Task two : To configure Trunk Link port

The task of this experiment is to configure Trunk Link port , Make the same VLAN Medium PC Ability to access across switches ask . Through this experiment , Students should be able to master Trunk Configuration and function of link ports .

Step one : Cross switch VLAN Interworking test

In the last experiment ,PCA and PCC All belong to VLAN 2. stay PCA On the use of Ping Command to test and PCC Can we communicate . The result should not be , As shown below :

C:\Documents and Settings\Administrator>ping 172.16.0.3
Pinging 172.16.0.3 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 172.16.0.3:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

PCA And PCC We can't communicate with each other . Because the ports between switches GigabitEthernet 1/0/24 yes Access Link port , And belongs to VLAN 1, Don't allow VLAN 2 The data frame passes through .

Want to let VLAN 2 The data frame passes through the port GigabitEthernet 1/0/24, You need to set the port to Trunk Link port .

Step two : To configure Trunk Link port

stay SWA and SWB Configure ports on GigabitEthernet 1/0/24 by Trunk Link port .

To configure SWA:

[SWA]interface GigabitEthernet 1/0/24
[SWA-GigabitEthernet1/0/24]port link-type trunk
[SWA-GigabitEthernet1/0/24]port trunk permit vlan all

To configure SWB:

[SWB]interface GigabitEthernet 1/0/24
[SWB-GigabitEthernet1/0/24]port link-type trunk
[SWB-GigabitEthernet1/0/24]port trunk permit vlan all

When the configuration is complete , see VLAN 2 Information :

<SWA>display vlan 2
VLAN ID: 2
VLAN type: Static
Route interface: Not configured
Description: VLAN 0002
Name: VLAN 0002
Tagged Ports:
GigabitEthernet1/0/24
Untagged Ports:
GigabitEthernet1/0/1

You can see ,VLAN 2 Port is included in GigabitEthernet 1/0/24, And the data frame is labeled (Tagged) Through the port .

Then check the port GigabitEthernet 1/0/24 Information :

<SWA>display interface GigabitEthernet 1/0/24
…….
PVID: 1
Mdi type: auto
Port link-type: trunk
VLAN passing : 1(default vlan), 2
VLAN permitted: 1(default vlan), 2-4094
Trunk port encapsulation: IEEE 802.1q
……

From the above information , Port of PVID The value is 1, The port type is Trunk, Allow all VLAN(1-4094) adopt , But it's actually VLAN 1 and VLAN 2 Through this port ( Because there are only VLAN 1 and VLAN 2).

SWB On VLAN And port GigabitEthernet 1/0/24 The information is similar to this , I won't repeat .

Step three : Cross switch VLAN Interworking test

stay PCA On the use of Ping Command to test and PCC Can we communicate . The result should be interoperability , As shown below :

C:\Documents and Settings\Administrator>ping 172.16.0.3
Pinging 172.16.0.3 with 32 bytes of data:
Reply from 172.16.0.3: bytes=32 time<1ms TTL=128
Reply from 172.16.0.3: bytes=32 time<1ms TTL=128
Reply from 172.16.0.3: bytes=32 time<1ms TTL=128
Reply from 172.16.0.3: bytes=32 time<1ms TTL=128
Ping statistics for 172.16.0.3:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms

Description cross switch VLAN Can communicate with each other .

3、 ... and 、 List of commands in the experiment

VLAN List of experimental commands :

command

describe

display vlan

Show... On the switch VLAN Information

display interface [ interface-type [ interface-number ] ]

Displays the current running status and related information of the specified interface

display vlan vlan-id

Displays the specified on the switch VLAN Information

vlan vlan-id

establish VLAN And enter VLAN View

port interface-list

towards VLAN Add one or a group Access port

port link-type{ access

hybrid

port trunk permit vlan { vlan-id-list

all }

Four 、VLAN Interview technical questions

1. In experiment task 2 , Which link port type can also be used to make the switch port G1/0/24 allow VLAN 2 The data frame passes through ?

answer : have access to Hybrid Link port .

2. In experiment task 2 , If configured SWA The port of G1/0/24 by Trunk type ,PVID by 1,SWB The port of G1/0/24 by Access type ,PVID Also for the 1, be PCB And PCD Can we communicate with each other ?

answer : Sure . The link port type only defines the behavior when data frames enter and leave the port . The switch does not know or care about the link type of the opposite port .

原网站

版权声明
本文为[Network technology alliance station]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/04/20210426102438374j.html