发布网友 发布时间:2022-04-30 17:34
共1个回答
热心网友 时间:2022-06-28 12:26
上图能实现的:二层和二层互绑,二层和三层互绑,三层和三层互绑。
<Huawei>system-view //开启窗口视图
[Huawei]vlan 10 //创建vlan10
[Huawei-vlan10]vlan 20
[Huawei-vlan20]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type access //把接口模式改成access模式
[Huawei-Ethernet0/0/1]port default vlan 10 //在接口上加vlan成员
[Huawei]int Eth-Trunk 1 //创建以太网组1
[Huawei-Eth-Trunk1]int e0/0/17 //进接口
[Huawei-Ethernet0/0/17]eth-trunk 1 //添加到以太网组1
[Huawei-Ethernet0/0/17]int e0/0/18
[Huawei-Ethernet0/0/18]eth-trunk 1
[Huawei]int Eth-Trunk 2
[Huawei-Eth-Trunk2]int e0/0/21
[Huawei-Ethernet0/0/21]eth-trunk 2
[Huawei-Ethernet0/0/21]int e0/0/22
[Huawei-Ethernet0/0/22]eth-trunk 2
[Huawei-Ethernet0/0/18]qu
[Huawei]int Eth-Trunk 1 //进入以太网1
[Huawei-Eth-Trunk1]port link-type trunk //把模式改为trunk
[Huawei-Eth-Trunk1]port trunk allow-pass vlan all //允许所有的vlan过
[Huawei]int Eth-Trunk 2
[Huawei-Eth-Trunk2]port link-type trunk
[Huawei-Eth-Trunk2]port trunk allow-pass vlan all
LSW2
<Huawei>system-view
[Huawei]vlan 10
[Huawei-vlan10]vlan 20
[Huawei-vlan20]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port default vlan 20
[Huawei]quit
[Huawei]int Eth-Trunk 1
[Huawei-Eth-Trunk1]int e0/0/17
[Huawei-Ethernet0/0/17]eth-trunk 1
[Huawei-Ethernet0/0/17]int e0/0/18
[Huawei-Ethernet0/0/18]eth-trunk 1
[Huawei-Ethernet0/0/18]qu
[Huawei]int Eth-Trunk 1
[Huawei-Eth-Trunk1]port link-type trunk
[Huawei-Eth-Trunk1]port trunk allow-passvlan all
AR1
<Huawei>system-view
[Huawei]int Eth-Trunk 2
[Huawei-Eth-Trunk2]undo portswitch
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]eth-trunk 2
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]eth-trunk 2
[Huawei]int Eth-Trunk2 //进入以太网组2
[Huawei-Eth-Trunk2]undo shutdown //开启接口
[Huawei-Eth-Trunk2]int eth-trunk 2.10 //进子接口
[Huawei-Eth-Trunk2.10]dot1q termination vid 10 //封装子接口vlan10
[Huawei-Eth-Trunk2.10]arp broadcast enable
[Huawei-Eth-Trunk2.10]ip add 192.168.10.1 24 //配vlan10的网关
[Huawei-Eth-Trunk2.10]int eth-trunk 2.20
[Huawei-Eth-Trunk2.20]dot1q termination vid 20
[Huawei-Eth-Trunk2.20]arp broadcast enable
[Huawei-Eth-Trunk2.20]ip add 192.168.20.1 24
[Huawei-Eth-Trunk2.20]un shut
[Huawei]int Eth-Trunk3
[Huawei-Eth-Trunk3]undo portswitch //把一个接口变成三层口
[Huawei-GigabitEthernet1/0/0]eth-trunk 3
[Huawei-GigabitEthernet1/0/0]int g2/0/0
[Huawei-GigabitEthernet2/0/0]eth-trunk 3
[Huawei-GigabitEthernet2/0/0]int eth-trunk 3
[Huawei-Eth-Trunk3]ip add 202.106.1.10 24 //配ip地址
[Huawei-Eth-Trunk3]un shut
AR2
<Huawei>sy
[Huawei-Eth-Trunk3]undo portswitch
[Huawei-GigabitEthernet0/0/0]eth-trunk 3
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]eth-trunk 3
[Huawei-GigabitEthernet0/0/1]int eth-trunk 3
[Huawei-Eth-Trunk3]ip add 202.106.1.20 24
[Huawei-Eth-Trunk3]un shut
你根据自己的实际情况做配置,配置后保存下,再ping下是否通 就可以了