8.华为交换机知识【实验一】

任务:配置vlan间通过vlanif接口进行通信,要求LSW2上vlan10里的pc1与vlan20里的pc2之间能相互通信
在eNSP模拟器上交换机没有Eth接口,为完成此配置实验,需准备如下的数据:
1.在LSW1上配置接口GE0/0/1加入VLAN10 和VLAN20。
2.在LSW1上配置VLANIF10 的IP 地址为192.168.2.1/24。
3.在LSW1上配置VLANIF20 的IP 地址为192.168.3.1/24。
4.在LSW2上配置接口GE0/0/1加入VLAN10 和VLAN20。
6.在LSW2上配置接口GE0/0/2加入VLAN10。
7.在LSW2上配置接口GE0/0/3加入VLAN20。
设备之间连接如下图所示: 
图片
操作如下:
一、配置交换机LSW1
<Huawei> system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei] undo info-center enable
Info: Information center is disabled.


[Huawei] vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei] interface giga 0/0/1
[Huawei-GigabitEthernet0/0/1] port link-type trunk
[Huawei-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 20
[Huawei-GigabitEthernet0/0/1] quit
[Huawei] interface vlanif 10
[Huawei-Vlanif10] ip address 192.168.2.1 24
[Huawei-Vlanif10] quit
[Huawei] interface vlanif 20
[Huawei-Vlanif20] ip address 192.168.3.1 24
[Huawei-Vlanif20] quit
[Huawei]

二、配置交换机LSW2
<Huawei> system-view
Enter system view, return user view with Ctrl+Z.
[Huawei] undo info-center enable
Info: Information center is disabled.
[Huawei] vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei] interface giga 0/0/1
[Huawei-GigabitEthernet0/0/1 ]port link-type trunk
[Huawei-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 20
[Huawei-GigabitEthernet0/0/1] quit
[Huawei]interface eth 0/0/1
                      ^
Error: Wrong parameter found at '^' position.
[Huawei]interface ethernet 0/0/1
                  ^
Error: Wrong parameter found at '^' position.
上面的命令出错了,在模拟器上没有ethernet接口
[Huawei] interface giga 0/0/2
[Huawei-GigabitEthernet0/0/2] port link-type access
[Huawei-GigabitEthernet0/0/2] port default vlan 10
[Huawei-GigabitEthernet0/0/2] quit
[Huawei] interface giga 0/0/3
[Huawei-GigabitEthernet0/0/3] port link-type access
[Huawei-GigabitEthernet0/0/3] port default vlan 20
[Huawei-GigabitEthernet0/0/3] quit
[Huawei] User interface con0 is available

三、配置两台PC电脑
 设置PC1的IP为 192.168.2.2 24 192.168.2.1
 设置PC2的IP为 192.168.3.2 24 192.168.3.1 

四、检查结果
在PC1上能ping通PC2
在PC2上能ping通PC1
配置前与配置后的对比
Welcome to use PC Simulator!
PC> ping 192.168.2.2
Ping 192.168.2.2: 32 data bytes, Press Ctrl_C to break
From 192.168.3.2: Destination host unreachable
From 192.168.3.2: Destination host unreachable
From 192.168.3.2: Destination host unreachable
From 192.168.3.2: Destination host unreachable
From 192.168.3.2: Destination host unreachable
PC> ping 192.168.2.2
Ping 192.168.2.2: 32 data bytes, Press Ctrl_C to break
From 192.168.2.2: bytes=32 seq=1 ttl=127 time=62 ms
From 192.168.2.2: bytes=32 seq=2 ttl=127 time=47 ms
From 192.168.2.2: bytes=32 seq=3 ttl=127 time=63 ms
From 192.168.2.2: bytes=32 seq=4 ttl=127 time=47 ms
From 192.168.2.2: bytes=32 seq=5 ttl=127 time=47 ms
--- 192.168.2.2 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 47/53/63 ms
PC> 
实验用的拓扑文件在附件中,可以直接下载使用。

你可能感兴趣的:(知识,实验,华为交换机)