h3c 配置实例 csdn
时间: 2023-09-27 09:04:42 浏览: 89
h3c交换机典型配置实例
4星 · 用户满意度95%
以下是H3C配置实例:
1. 配置VLAN
创建VLAN 10和20,并将端口GigabitEthernet 1/0/1和GigabitEthernet 2/0/1划分到VLAN 10,将端口GigabitEthernet 1/0/2和GigabitEthernet 2/0/2划分到VLAN 20。
```
<Switch> system-view
[Switch] vlan batch 10 20
[Switch] interface GigabitEthernet 1/0/1
[Switch-GigabitEthernet1/0/1] port link-type access
[Switch-GigabitEthernet1/0/1] port default vlan 10
[Switch-GigabitEthernet1/0/1] quit
[Switch] interface GigabitEthernet 2/0/1
[Switch-GigabitEthernet2/0/1] port link-type access
[Switch-GigabitEthernet2/0/1] port default vlan 10
[Switch-GigabitEthernet2/0/1] quit
[Switch] interface GigabitEthernet 1/0/2
[Switch-GigabitEthernet1/0/2] port link-type access
[Switch-GigabitEthernet1/0/2] port default vlan 20
[Switch-GigabitEthernet1/0/2] quit
[Switch] interface GigabitEthernet 2/0/2
[Switch-GigabitEthernet2/0/2] port link-type access
[Switch-GigabitEthernet2/0/2] port default vlan 20
[Switch-GigabitEthernet2/0/2] quit
```
2. 配置端口镜像
将端口GigabitEthernet 1/0/1的数据镜像到端口GigabitEthernet 2/0/1。
```
<Switch> system-view
[Switch] interface GigabitEthernet 1/0/1
[Switch-GigabitEthernet1/0/1] port mirror enable
[Switch-GigabitEthernet1/0/1] port mirror to-port GigabitEthernet 2/0/1 both
[Switch-GigabitEthernet1/0/1] quit
```
3. 配置DHCP服务器
配置DHCP服务器地址池为192.168.1.2-192.168.1.100,网关为192.168.1.1。
```
<Switch> system-view
[Switch] dhcp enable
[Switch] dhcp server ip-pool 1
[Switch-dhcp-server-ip-pool-1] gateway-list 192.168.1.1
[Switch-dhcp-server-ip-pool-1] network 192.168.1.0 mask 255.255.255.0
[Switch-dhcp-server-ip-pool-1] dns-list 8.8.8.8
[Switch-dhcp-server-ip-pool-1] lease day 3
[Switch-dhcp-server-ip-pool-1] excluded-ip-address 192.168.1.1
[Switch-dhcp-server-ip-pool-1] excluded-ip-address 192.168.1.101 to 192.168.1.254
[Switch-dhcp-server-ip-pool-1] address-range 192.168.1.2 192.168.1.100
[Switch-dhcp-server-ip-pool-1] quit
```
以上是H3C的常用配置实例,希望能对您有所帮助。
阅读全文