Operating System - Linux
1753931 Members
9532 Online
108810 Solutions
New Discussion юеВ

Can a DHCP server cater to desktops on multiple VLANs

 
GnanaShekar
Regular Advisor

Can a DHCP server cater to desktops on multiple VLANs

Hi,

In my lab we have a couple of cisco switches.
Each switch has different VLAN's and the desktops are connected to it.
Switch1
VLANS:
172.22.42.0/26
172.22.42.64/26
172.22.43.0/24
Switch2
VLANS:
172.22.40.0/23
172.22.42.128/26

We are planning to install Linux (Redhat / SUSE) on these desktops through network.
I have installed RHEL5x86 on one of the desktops and want to use this as the PXE installation server and DHCP server.

Can I have a single DHCP server catering to all the desktops on all the VLAN's?

I went through the man page for dhcpd.conf. I think my situation here is: I have a physical network in which multiple IP subnets operate. In this case I can have a "shared-network" declaration which in turn contains "subnet" declarations for each of the IP subnets/VLANs.

How will the DHCP server be able to know which IP address to lease to which desktop?

Please suggest,
Thanks & Regards,
3 REPLIES 3
Stuart Browne
Honored Contributor

Re: Can a DHCP server cater to desktops on multiple VLANs

In my previous job, we had one centralized DHCP server serving addresses for the entire WAN.

So long as the DHCP server can be routed to from the various VLAN's, then the DHCP server can happiliy have different subnet's dynamic ranges.

That being said, you will need configure your switch VLAN's to have a dhcp helper (also known as a 'udp helper address', IOS interface command 'ip helper-address '. It tells the VLAN where the DHCP server resides so the request can be forwarded/routed correctly).

You don't what the 'shared-network' model. You're not trying to span the subnet's to get a supernet. You're just running multiple small subnets in the same physical environment.

The DHCP server will know where the DHCP request comes from by the helper that forwards the DHCP request.
One long-haired git at your service...
Arnd Kohlen
Advisor

Re: Can a DHCP server cater to desktops on multiple VLANs

Hi,

You must activate vlan support in the kernel of your dhcp server. Then for example if your dhcp server (eth0) is connected to switch1, port 1 you must set this port tagged to all your vlans on that switch.

Let's assume, switch1:
172.22.42.0/26 = vlan420
172.22.42.64/26 = vlan421
172.22.43.0/24 = vlan430

Your dhcp-server must then be configured with the interfaces vlan420, vlan421, vlan430 and needs to listen on these interfaces. After that you can configure any subnet in your dhcpd.conf

You can use another interface (eth1) for the second switch or you configure them to have all your vlans on both switches.

I don't have RedHat here, so I can't be more specific on the configuration.

If you have any further questions, please ask.

Regards,
Arnd

GnanaShekar
Regular Advisor

Re: Can a DHCP server cater to desktops on multiple VLANs

Hi,

I do not have access to the switch.
But, in the meanwhile I thought of using a dhcp relay.
I setup a dhcp relay on a desktop on each VLAN. This would forward the DHCP request to the DHCP server and the reply to client.

The good news is the desktops on the VLAN are able to get the dynamic IP address from the DHCP server through the dhcp relay.

The bad news is :
1. I am getting a TFTP error message
PXE-E32: TFTP open timeout
2. Also the client is being assigned 2 gateway IP's. One that belongs to dhcp relay server, and one given from the DHCP server for that subnet.

Please suggest,
Thanks & Regards.