- 实验效果:pc1可以ping通pc2,可以ping通桥接的云
- 实验步骤
配置lsw1交换机
<Huawei>sys 进入系统视图
[Huawei]un in en 关闭广告
[Huawei]vlan batch 10 20 30 创建多个vlan10,20,30
[Huawei]int g0/0/1 进接口
[Huawei-GigabitEthernet0/0/1]port link-type access 链路类型为access接入
[Huawei-GigabitEthernet0/0/1]port default vlan 10 加入到vlan10当中
[Huawei-GigabitEthernet0/0/1]q
[Huawei]int Eth-Trunk 3 创建一个以太网通道3
[Huawei-Eth-Trunk3]trunkport g 0/0/4 0/0/5 绑定多个接口g0/0/4,g0/0/5
[Huawei-Eth-Trunk3]port link-type access 链路类型为access接入
[Huawei-Eth-Trunk3]port default vlan 30 加入到vlan30当中
[Huawei-Eth-Trunk3]q
[Huawei]int vlan 10 设置虚拟vlan10的IP
[Huawei-Vlanif10]ip add 192.168.10.1 24
[Huawei-Vlanif10]q
[Huawei]int vlan 30
[Huawei-Vlanif30]ip add 192.168.30.1 24
[Huawei-Vlanif30]q
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.30.2 指一条默认路由,指上面的路由器
[Huawei]int Eth-Trunk 4 创建一个以太网通道4
[Huawei-Eth-Trunk4]trunkport g 0/0/2 0/0/3 绑定多个接口g0/0/2,g0/0/3
[Huawei-Eth-Trunk4]port link-type access 链路类型为access接入
[Huawei-Eth-Trunk4]port default vlan 20 加入到vlan20当中
[Huawei-Eth-Trunk4]q
[Huawei]int vlan 20 设置虚拟vlan20的IP
[Huawei-Vlanif20]ip add 192.168.20.1 24
[Huawei-Vlanif20]q
[Huawei]display ip int b 查看ip信息
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 2
Interface IP Address/Mask Physical Protocol
MEth0/0/1 unassigned down down
NULL0 unassigned up up(s)
Vlanif1 unassigned down down
Vlanif10 192.168.10.1/24 up up
Vlanif20 192.168.20.1/24 up up
Vlanif30 192.168.30.1/24 up up
[Huawei]display eth-trunk 4 查看以太网通道的信息
Eth-Trunk4's state information is:
WorkingMode: NORMAL Hash arithmetic: According to SIP-XOR-DIP
Least Active-linknumber: 1 Max Bandwidth-affected-linknumber: 8
Operate status: up Number Of Up Port In Trunk: 2
--------------------------------------------------------------------------------
PortName Status Weight
GigabitEthernet0/0/2 Up 1
GigabitEthernet0/0/3 Up 1
- 配置r1路由器
<Huawei>sys
[Huawei]un in en
[Huawei]int Eth-Trunk 3 注意和上面的要在同一个组
[Huawei-Eth-Trunk3]trunkport g 0/0/1 0/0/0
[Huawei-Eth-Trunk3]ip add 192.168.30.2 24
[Huawei-Eth-Trunk3]q
[Huawei]ip route-static 192.168.40.0 24 1.1.1.2 指路,上面那台pc1的网段(目标网段,子网掩码,下一跳)
[Huawei]int Eth-Trunk 1
[Huawei-Eth-Trunk1]trunkport g 0/0/2 0/0/3
[Huawei-Eth-Trunk1]ip add 1.1.1.1 24
[Huawei-Eth-Trunk1]q
[Huawei]ip route-static 192.168.10.0 24 192.168.30.1 指路,下面两台pc的网段(目标网段,子网掩码,下一跳)
[Huawei]ip route-static 192.168.20.0 24 192.168.30.1
- 配置R2路由器
<Huawei>sys
[Huawei]un in en
[Huawei]int Eth-Trunk 1
[Huawei-Eth-Trunk1]trunkport g 0/0/0 0/0/1
[Huawei-Eth-Trunk1]ip add 1.1.1.2 24
[Huawei-Eth-Trunk1]q
[Huawei]ip route-static 0.0.0.0 0.0.0.0 1.1.1.1
[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]ip add 192.168.40.1 24
[Huawei-GigabitEthernet0/0/2]q
- 然后pc1pingpc2可以ping通
然后打开win7虚拟机,添加两个网卡,然后点住两个网卡右击点击桥接,然后用pc1ping虚拟机,可以在ensp中shutdown一个接口,依然可以通信