交换机 VLAN 划分及dhcp 配置


一、华为交换机,创建 vlan 10 20 30 然后配置这3个 vlan 的dhcp

vlan 10
exit
vlan 20
exit
vlan 30
exit

#配置 VLAN IP地址

int vlan10
ip add 192.168.10.1 255.255.255.0

int vlan20
ip add 192.168.20.1 255.255.255.0

int vlan30
ip add 192.168.30.1 255.255.255.0


#配置dhcp
ip pool vlan10
 gateway-list 192.168.10.1
 network 192.168.10.0 mask 255.255.255.0
 excluded-ip-address 192.168.10.10 192.168.10.200
 dns-list 202.106.46.151 114.114.114.114

ip pool vlan20
 gateway-list 192.168.20.1
 network 192.168.20.0 mask 255.255.255.0
 excluded-ip-address 192.168.20.10 192.168.20.200
 dns-list 202.106.46.151 114.114.114.114

ip pool vlan30
 gateway-list 192.168.30.1
 network 192.168.30.0 mask 255.255.255.0
 excluded-ip-address 192.168.30.10 192.168.30.200
 dns-list 202.106.46.151 114.114.114.114

int vlan 10
dhcp select global
int vlan 20
dhcp select global
int vlan 30
dhcp select global

int range g0/0/1 to g0/0/15
port default vlan 10

二、华三交换机,创建 vlan 10 20 30 然后配置这3个 vlan 的dhcp

vlan 10 to 30
interface Vlan-interface10
 ip address 192.168.10.254 255.255.255.0

dhcp server forbidden-ip 192.168.10.1 192.168.10.10

dhcp server ip-pool 10
 network 192.168.10.0 mask 255.255.255.0
 gateway-list 192.168.10.254
 dns-list 114.114.114.114 202.106.0.20
 expired day 0 hour 12
#默认到期时间是1天
#