I have a layer 2 switch, PC 1 connected to port 1 and PC 2 connected to port 2.
- Port 1 is in VLAN 20
- Port 2 is in VLAN 21
Can I use a single DHCP server without a router and give IP to both the PCs?
I don't want to route coz I don't want VLANs 20 and 21 to communicate, I need the networks to be isolated.
Best Answer
There are basically two ways to do this:
ip helper dhcp
), but this router doesn't have to route packets, or can have all traffic prohibited between the VLANs. Also host-based DHCP systems can relay (eg ISC'sdhcrelay
). With this setup, the actual DHCP server has to know how to deal with remote networks (Cisco's and ISC's both work fine for this.)Single DHCP server in both networks, with two interfaces or with trunk.
With DHCP relays in each network, forwarding to a DHCP server elsewhere. (Could be on adjacent LAN, across the corporate network, or, unwisely, across the internet.)
In a real network, you might think about starting from a point like this, where there's a control LAN for multiple redundant DHCP servers, LDAP etc, connected by router to the VLANs. This router would have DHCP relaying enabled, and control traffic between the VLANs and the internet. In reality it might well be multiple routers with some hot standby mechanism (HSRP, VRRP etc)>