登陆交换机,进入全局配置模式
SWITCH>en
Password:
SWITCH#
SWITCH#config t
Enter configuration commands, one per line. End with CNTL/Z.
SWITCH(config)#
配置vlan2的ip地址池:
SWITCH(config)# ip dhcp pool vlan2
SWITCH(dhcp-config)# network 192.168.2.0 255.255.255.0
SWITCH(dhcp-config)# default-router 192.168.2.1
SWITCH(dhcp-config)# dns-server 192.168.1.254 114.114.114.114
配置vlan3的ip地址池:
SWITCH(config)# ip dhcp pool vlan3
SWITCH(dhcp-config)# network 192.168.3.0 255.255.255.0
SWITCH(dhcp-config)# default-router 192.168.3.1
SWITCH(dhcp-config)# dns-server 192.168.1.254 114.114.114.114
排除部分IP地址不再分配:
SWITCH(config)# ip dhcp excluded-address 192.168.2.1 192.168.2.20
SWITCH(config)# ip dhcp excluded-address 192.168.2.201 192.168.2.254
SWITCH(config)# ip dhcp excluded-address 192.168.3.1 192.168.3.20
针对单台电脑配置固定IP地址:
SWITCH(config)# ip dhcp pool vlan2-myIP
SWITCH(dhcp-config)# host 192.168.2.2 255.255.255.0
SWITCH(dhcp-config)# client-identifier 0130.52cb.caa7.a2
SWITCH(dhcp-config)# default-router 192.168.2.1
SWITCH(dhcp-config)# dns-server 192.168.1.254 202.96.134.133
Zabbix5.0企业级分布式监控系统:精讲与企业应用