1、租期相关命令
静态绑定MAC指定IP地址:static-bind ip-address 192.168.8.234 mac-address 5489-980C-077E
租期配置:[SW1-ip-pool-8]lease day 2 hour 2 minute 3
reset ip pool interface vlanif9 used 重置DHCP分配记录
reset ip pool interface Ethernet0/0/0 used 重置某个接口地址 (接口不能简写)
2、配置步骤
1、配置接入层交换机接口模式
vlan 8
interface Ethernet0/0/2
port link-type access
port default vlan 8
interface Ethernet0/0/3
port link-type access
port default vlan 8
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
2、配置核心交换机接口模式
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
3、启动DHCP及创建地址池
dhcp enable
#
ip pool 8
gateway-list 192.168.8.1
network 192.168.8.0 mask 255.255.255.0
dns-list 114.114.114.114 8.8.8.8
ip pool 9
gateway-list 192.168.9.1
network 192.168.9.0 mask 255.255.255.0
dns-list 114.114.114.114 8.8.8.8
4、配置SVI 及DHCP获取模式
interface Vlanif8
ip address 192.168.8.1 255.255.255.0
dhcp select global
interface Vlanif9
ip address 192.168.9.1 255.255.255.0
dhcp select global