华为交换机配置实例

华为交换机配置实例

  1. 拓扑

  2. PC的IP设置

  3. 交换机配置

  4. 测试

    1拓扑模型

image.png

本实验目的是将PC1与PC3划分在一个VLAN下并实现

将PC2与PC5划分在一个VLAN下

2PC的IP设置

IP地址子网掩码
PC1192.168.1.1255.255.255.0
PC2192.168.1.2255.255.255.0
PC3192.168.1.3255.255.255.0
PC5192.168.1.4255.255.255.0

3交换机配置

<Huawei>system-view
[Huawei]vlan 10
[Huawei-vlan10]
Jul  9 2020 09:23:40-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5
.25.191.3.1 configurations have been changed. The current change number is 4, th
e change loop count is 0, and the maximum number of records is 4095.
[Huawei-vlan10]q
[Huawei]vlan 20
[Huawei-vlan20]
Jul  9 2020 09:24:00-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5
.25.191.3.1 configurations have been changed. The current change number is 5, th
e change loop count is 0, and the maximum number of records is 4095.
[Huawei-vlan20]q
[Huawei]interface Ethernet 0/0/1
[Huawei-Ethernet0/0/1]port link-type access 
[Huawei-Ethernet0/0/1]port default vlan 10
[Huawei]interface Ethernet 0/0/2
[Huawei-Ethernet0/0/2]port link-type access 
[Huawei-Ethernet0/0/2]port default vlan 10
[Huawei]interface Ethernet 0/0/3
[Huawei-Ethernet0/0/3]port link-type trunk 
[Huawei-Ethernet0/0/3]
Jul  9 2020 09:29:40-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5
.25.191.3.1 configurations have been changed. The current change number is 8, th
e change loop count is 0, and the maximum number of records is 4095.
[Huawei-Ethernet0/0/3]port trunk allow-pass vlan 10 20
[Huawei-Ethernet0/0/3]q
[Huawei]interface Ethernet 0/0/4
[Huawei-Ethernet0/0/4]port link-type trunk
[Huawei-Ethernet0/0/4]port trunk allow-pass vlan 10 20

两台交换机配置相同

测试

在PC1上测试

Welcome to use PC Simulator!

PC>ping 192.168.1.3

Ping 192.168.1.3: 32 data bytes, Press Ctrl_C to break
From 192.168.1.3: bytes=32 seq=1 ttl=128 time=62 ms
From 192.168.1.3: bytes=32 seq=2 ttl=128 time=47 ms
From 192.168.1.3: bytes=32 seq=3 ttl=128 time=63 ms
From 192.168.1.3: bytes=32 seq=4 ttl=128 time=63 ms
From 192.168.1.3: bytes=32 seq=5 ttl=128 time=62 ms

--- 192.168.1.3 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 47/59/63 ms

PC>192.168.1.2
Invalid command!

PC>ping 192.168.1.2

Ping 192.168.1.2: 32 data bytes, Press Ctrl_C to break
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable

--- 192.168.1.2 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

PC>ping 192.168.1.4

Ping 192.168.1.4: 32 data bytes, Press Ctrl_C to break
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable

--- 192.168.1.4 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

** PC1与PC3可以通信,与PC2\PC5不能通信. **

  • 3
    点赞
  • 35
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值