HCL 练习 含有vlan trunk

使用2个交换机,2台PC机,使得2台机器能够通过vlan100进行通讯

HCL 练习 含有vlan trunk_第1张图片

  • 简单连接后的通讯

当简单连接后,设置PC机的ip,二者可以通讯

  • 设置3 4 在vlan100 内,也就是在交换机1 2 上设置连接端口1 在vlan100上,具体交换机上的命令如下

交换机1
以下是通过设置端口10 为trunk口

sys
[H3C]interface GigabitEthernet 1/0/10
[H3C-GigabitEthernet1/0/10]port link-type trunk
[H3C-GigabitEthernet1/0/10]port trunk permit vlan 100
[H3C-GigabitEthernet1/0/10]quit

交换机2

sys
[H3C]interface GigabitEthernet 1/0/10
[H3C-GigabitEthernet1/0/10]port link-type trunk
[H3C-GigabitEthernet1/0/10]port trunk permit vlan 100
[H3C-GigabitEthernet1/0/10]quit

设置好后,再使2个PC机ping就可以了

方法二 是直接将10号端口放到vlan100中

交换机1

[H3C]interface GigabitEthernet 1/0/10
[H3C-GigabitEthernet1/0/10]port link-type access
[H3C-GigabitEthernet1/0/10]quit
[H3C]display vlan 100
 VLAN ID: 100
 VLAN type: Static
 Route interface: Not configured
 Description: VLAN 0100
 Name: VLAN 0100
 Tagged ports:   None
 Untagged ports:
    GigabitEthernet1/0/1
[H3C]vlan 100
[H3C-vlan100]port GigabitEthernet 1/0/10
[H3C-vlan100]quit
[H3C]

交换机2

[H3C]interface GigabitEthernet 1/0/10
[H3C-GigabitEthernet1/0/10]port link-type access
[H3C-GigabitEthernet1/0/10]quit
[H3C]display vlan 100
 VLAN ID: 100
 VLAN type: Static
 Route interface: Not configured
 Description: VLAN 0100
 Name: VLAN 0100
 Tagged ports:   None
 Untagged ports:
    GigabitEthernet1/0/1
[H3C]vlan 100
[H3C-vlan100]port GigabitEthernet 1/0/10
[H3C-vlan100]quit
[H3C]

将2个交换机的1 10 口设置到一个vlan后 俩个PC设备可以进行通讯。

你可能感兴趣的:(H3C)