I have an Ubuntu machine on which I have created four VLANs, namely eth0.100
,eth0.200
, eth0.300
and eth0.400
. I want to dynamically obtain the IP addresses using the DHCP server. It should provide an IP from different range of IP addresses, i.e.
for VLAN interface eth0.100,--> 192.168.0.20 - 192.168.0.40
for VLAN interface eth0.200 --> 192.168.0.50 - 192.168.0.70
for eth0.300 and eth0.400 --> likewise
How can I implement this? How will I read the VLAN ID of the interface which is requesting the IP address? How will I convey the information about the VLANs running on the client to the DHCP server?
I think I should create VLAN interfaces on the DHCP server also. If I do, how will I let the DHCP server know the presence of VLANs?
I am stuck in this. How should I proceed?