环境简述

目的通过交换机设置12个Vlan,每个端口DHCP动态获取地址,ip地址池设置在1-3三个地址,47口作为镜像端口,源端口为1-12
vlan的地址为101-112,这里以Vlan101为例,IP地址为10.0.1.x/24 网关 :10.0.1.254/24

华为交换机配置如下

1
2
3
4
5
6
7
8
9
10
11
12
[HUAWEI]vlan 101
[HUAWEI-vlan101]quit
[HUAWEI]interface Vlanif 101
[HUAWEI-Vlanif101]ip address 10.0.1.254 255.255.255.0
[HUAWEI-Vlanif101]dhcp select interface
[HUAWEI-Vlanif101]dhcp server ip-range 10.0.1.1 10.0.1.3
[HUAWEI-Vlanif101]dhcp server gateway-list 10.0.1.254
[HUAWEI-Vlanif101]dhcp server lease day 10
[HUAWEI-Vlanif101]quit
[HUAWEI]interface GigabitEthernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1]port default vlan 101
[HUAWEI-Vlanif101]quit

华为端口镜像

1
2
3
[HUAWEI]observe-port 1 interface GigabitEthernet 0/0/47
[HUAWEI]interface range GigabitEthernet 0/0/1 to GigabitEthernet 0/0/12
[HUAWEI-port-group]port-mirroring to observe-port 2 both

H3C交换机配置如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[H3C]vlan 101
[H3C-vlan101]quit
[H3C]interface Vlan-interface 101
[H3C-Vlan-interface101]ip address 10.0.1.254 24
[H3C-Vlan-interface101]quit
[H3C]interface GigabitEthernet 1/0/1
[H3C-GigabitEthernet1/0/1]port access vlan 101
[H3C-GigabitEthernet1/0/1]quit
[H3C]dhcp server ip-pool 113
[H3C-dhcp-pool-113]gateway-list 10.0.13.254
[H3C-dhcp-pool-113]network 10.0.13.0 24
[H3C-dhcp-pool-113]address range 10.0.13.1 10.0.13.3
[H3C-dhcp-pool-113]expired day 10
[H3C-dhcp-pool-113]dns-list 8.8.8.8
[H3C-dhcp-pool-113]quit

H3C端口镜像

1
2
3
4
5
[H3C]mirroring-group 1 local
[H3C]mirroring-group 1 monitor-port GigabitEthernet 1/0/47
[H3C]interface range GigabitEthernet 1/0/1 to GigabitEthernet 1/0/12
[H3C-if-range]mirroring-group 1 mirroring-port both