简体   繁体   English

在交换机上使用VLAN配置DHCP服务器

[英]Configuring a DHCP server with VLAN on a switch

I have a problem while configuring a switch, I want to create a VLAN and to activate the DHCP server and so all switch ports associated to this VLAN will receive automatically an IP address from the DHCP server. 配置交换机时遇到问题,我想创建一个VLAN并激活DHCP服务器,因此与此VLAN关联的所有交换机端口将自动从DHCP服务器接收IP地址。

So I want to ask you if this is possible ? 所以我想问你这是否可行? and If 'yes', how can I dot it ? 如果是,我该如何加点? because I didn't found the appropriates commands (cisco or d-link) ! 因为我没有找到适当的命令(cisco或d-link)!

yes, of course it's possible 是的,当然有可能

take a look at this, i think it's what u want : 看看这个,我想这就是你想要的:

Vlan's and DHCP VLAN和DHCP

Here is what u should do : 这是你应该做的:

ip dhcp pool pool1
network 10.10.1.0 255.255.255.0
default-router 10.10.1.1 
dns-server what.ever.ip.itis
!
ip dhcp pool pool2
   network 10.10.2.0 255.255.255.0
   default-router 10.10.2.1 
   dns-server what.ever.ip.itis2
vlan 10
 ip address 10.10.1.1 255.255.255.0
!
vlan 20
ip address 10.10.2.1 255.255.255.0

you must define two pools( or more ), and give them same range IP as u gave to your VLANs ... it will work ... 您必须定义两个池(或更多),并给它们与您给您的VLAN相同的范围IP ...它将起作用...

And you should also exclude ip addresses that the router uses (.1 in this example). 并且您还应该排除路由器使用的IP地址(在此示例中为.1)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM