华为交换机配置DHcp租期
时间: 2024-01-12 16:04:05 浏览: 284
华为交换机配置DHCP租期的步骤如下:
1. 进入交换机的全局配置模式:
```shell
system-view
```
2. 创建一个IP地址池,并指定网段、网关、DNS服务器和租期:
```shell
ip pool pool-name
network network-address { mask | mask-length }
gateway gateway-address
dns-list dns-server1 [ dns-server2... ]
lease day days hour hours minute minutes
```
其中,`pool-name`是IP地址池的名称,`network-address`是IP地址池的网段,`mask`或`mask-length`是子网掩码,`gateway-address`是网关地址,`dns-server1`、`dns-server2`等是DNS服务器的地址,`days`、`hours`和`minutes`是租期的天数、小时数和分钟数。
3. 配置保留地址和地址保留:
```shell
reserved-address { ip-address | ip-address1 - ip-address2 }
address-reservation { interface-type interface-number | interface-type interface-number1 - interface-number2 }
```
其中,`ip-address`是要保留的IP地址,`ip-address1`和`ip-address2`是要保留的IP地址范围,`interface-type`和`interface-number`是要保留的接口。
4. 退出全局配置模式:
```shell
quit
```
5. 将DHCP服务应用到接口:
```shell
interface interface-type interface-number
dhcp select interface
```
其中,`interface-type`和`interface-number`是要应用DHCP服务的接口。
下面是一个示例配置:
```shell
system-view
ip pool huawei
network 192.168.2.0 mask 24
gateway 192.168.2.1
dns-list 114.144.144.144
lease day 3
reserved-address 192.168.2.100 - 192.168.2.254
address-reservation interface-type interface-number1 - interface-number2
quit
interface gigabitethernet 0/0/1
dhcp select interface
```
阅读全文