Small and medium network enterprise construction - switch

The switch is the second layer in the seven layers of OSI. First of all, we know that because each port of the switch is a collision domain, and when the broadcast mode of the switch is broadcast, it will cause a certain amount of traffic of other hosts to be occupied, so we introduced vlan (virtual). LAN)
Small and medium network enterprise construction - switch
As shown in the figure, we can see that there are two switches and two hosts, the IP on PC1: 192.168.14.1, the gateway is 192.168.14.254, the IP on PC4: 192.168.14.2, the gateway is 192.168.14.254., LSW1 The link between the host and the switch is set to access, the link between the vlan 14 LSW2 host and the switch is set to hybrid, and the link between the vlan 14 switch and the switch is set to trunk, the command is as follows:
LSW1:
<Huawei >sys #Enter the system interface
[Huawei]vlan 14 #Create vlan 14
[Huawei-vlan14]int vlanif 14 # Configure a logical interface based on vlan14
[Huawei-Vlanif14]ip add 192.168.14.254 24 #Configure the logical interface address of a gateway
[Huawei-Vlanif14]q #launch the interface for configuring logical interfaces
[Huawei]int g0/0/1 #Enter the port interface of g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type access #Set the link of g0/0/1 to access (Note: access, it is the interface connecting the terminal device, that is, the client
[Huawei-GigabitEthernet0/0/1]port default vlan 14 #Add the access link to vlan 14
[Huawei-GigabitEthernet0/0/1]q #Quit the port interface of g0/0/1
[Huawei]int g0/0/3 #Enter the port interface of g0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type trunk #Set the link of g0/0/3 as trunk (Note: trunk can transmit data of multiple VLANs at the same time)
[Huawei-GigabitEthernet0/0/3]port trunk allow-pass vlan all #Allow all VLANs existing on the device to pass
LSW2
[Huawei]vlan 14 #Create vlan 14
[Huawei-vlan14]int vlanif 14 # Configure a logical interface based on vlan14
[Huawei-Vlanif14]ip add 192.168.14.254 24 #In Configure a gateway address on the logical interface
[Huawei-Vlanif14]q #launch the interface for configuring the logical interface
[Huawei]int g0/0/2 #Enter the port interface of g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type hybrid #Set the link of g0/0/2 to hybrid (Note: Hybrid is a flexible control to add or delete tags, tagged: tagged, untagged: untagged)
[Huawei-GigabitEthernet0/0/2 ]port hybrid pvid vlan 14 #Add hybrid link to vlan 14
[Huawei-GigabitEthernet0/0/2]port hybrid untagged vlan 14 #vlan 14 allows unlabeled
access to the port interface of g0/0/3 through [Huawei]int g0/0/3 #
[Huawei-GigabitEthernet0/0/3] port link-type trunk #Set the link of g0/0/3 as trunk
[Huawei-GigabitEthernet0/0/3]port trunk allow-pass vlan all #Allow all VLANs on the device to pass through
, that is, PC1 and PC4 can communicate with each other

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325327469&siteId=291194637