混杂模式实验
1、拓扑图
2、划分各个交换机的VLAN
lsw1:
[lsw1]vlan batch 2 3
Info: This operation may take a few seconds. Please wait for a moment...done
lsw2:
[Huawei]vlan batch 2 4
Info: This operation may take a few seconds. Please wait for a moment...done.
lsw3:
[Huawei]vlan batch 2 5
Info: This operation may take a few seconds. Please wait for a moment...done.
3、各个接口划入VLAN
LSW1:
[lsw1-GigabitEthernet0/0/1]port hybrid untagged vlan 2 to 5————U设置为VLAN 2—5
[lsw1-GigabitEthernet0/0/1]port hybrid tagged vlan 2————————T设置为VLAN 2
[lsw1-GigabitEthernet0/0/2]port link-type access ——————接口设置为access接口
[lsw1-GigabitEthernet0/0/2]port default vlan 2————————划分区域为VLAN 2
[lsw1-GigabitEthernet0/0/3]port hybrid pvid vlan 3——PVID设置为VLAN 3
[lsw1-GigabitEthernet0/0/3]port hybrid untagged vlan 3 to 5———— 添加允许列表3、4、5,同时定义其字母为U
[lsw1-GigabitEthernet0/0/4]port link-type trunk ——接口设置为trunk接口
[lsw1-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 to 5——接口trunk允许通过VLAN 2-5
LSW2:
[lsw2-GigabitEthernet0/0/1]port link-type trunk
[lsw2-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 to 5
[lsw2-GigabitEthernet0/0/3]port hybrid pvid vlan 4
[lsw2-GigabitEthernet0/0/3]port hybrid untagged vlan 2 to 4
[lsw2-GigabitEthernet0/0/2]port link-type access
[lsw2-GigabitEthernet0/0/2]port default vlan 2
[lsw2-GigabitEthernet0/0/4]port link-type trunk
[lsw2-port-group-trunk]port trunk allow-pass vlan 2 to 5
LSW3:
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 to 5
[Huawei-GigabitEthernet0/0/3]port hybrid pvid vlan 5
[Huawei-GigabitEthernet0/0/3]port hybrid untagged vlan 3 to 5
[Huawei-GigabitEthernet0/0/2]port hybrid pvid vlan 4
[Huawei-GigabitEthernet0/0/2]port hybrid untagged vlan 3 to 4
4、在路由器开启DHCP操作
1、创建子接口
[Huawei]interface g0/0/0.1
[Huawei-GigabitEthernet0/0/0.1]dot1q termination vid 2——子接口可以处理vlan 2的流量
[Huawei-GigabitEthernet0/0/0.1]ip addressip address 192.168.1.10 24——为子接口配置一个IP地址
[Huawei-GigabitEthernet0/0/0.1]arp broadcast enable——子接口开启ARP广播功能
[Huawei]interface g0/0/0.2
[Huawei-GigabitEthernet0/0/0.2]dot1q termination vid 3
[Huawei-GigabitEthernet0/0/0.2]ip address 192.168.2.10 24
[Huawei-GigabitEthernet0/0/0.2]arp broadcast enable
2、开启DHCP
[Huawei]ip pool a
Info: It's successful to create an IP address pool.
[Huawei-ip-pool-a]gateway-list 192.168.1.10
[Huawei-ip-pool-a]network 192.168.1.0 mask 24
[Huawei-ip-pool-a]dns-list 114.114.114.114
[Huawei-ip-pool-a]q
[Huawei]ip pool b
[Huawei-ip-pool-b]gateway-list 192.168.2.10
[Huawei-ip-pool-b]network 192.168.2.0 mask 24
[Huawei-ip-pool-b]dns-list 114.114.114.114
[Huawei-ip-pool-b]q
3、接口开启DHCP
[Huawei-GigabitEthernet0/0/0]dh
[Huawei-GigabitEthernet0/0/0]dhcp s
[Huawei-GigabitEthernet0/0/0]dhcp select g
[Huawei-GigabitEthernet0/0/0]dhcp select global
[Huawei-GigabitEthernet0/0/0]int g0/0/0.1
[Huawei-GigabitEthernet0/0/0.1]dhcp select global
[Huawei-GigabitEthernet0/0/0.1]q