-2

Possible Duplicate:
How do I dynamically obtain IP addresses for VLAN interfaces?

I am setting up a dhcp server to supply ip address for different VLANs of different subnet.(192.168.1.x for VLAN100, 192.168.2.x for VLAN200 and likewise for VLAN300)I have created VLANs 100,200,300 on eth0 on the ubuntu machine on which the dhcp server runs.I have configured the dhcp server to listen on all the virtual interfaces eth0.100 eth0.200 eth0.200. But when I run the dhclient for the interface eth0.100, how the server will recognize that this packet is from that particular interface? Will the dhcp request packet will contain the VLAN id? If so how the dhcp server will assign the address from that particular subnet. I think so in the configuration file we should specify that if the packet is on this particular interface say eth0.100 you should give IP from the subnet of 192.168.1.x.

I referred to DHCP server for multilple VLANs and the there is no such information in the dhcpd.config file saying the above information.I did not understand this. How the dhcp server assigns IP address from that particular range, as i think so only the VLAN id of the dhcp request packet is available to dhcp server. Can anyone please explain this? Forgive me for my ignorance as i am new to networks as well as Linux.

thanks and regards

vidhu

vidhu
  • 11
  • 1
  • 1
    When you ask a question on this site a list pops up showing previous questions that might be of use - DON'T IGNORE THIS LIST!! This question has been asked MANY times before, including just the other day - do your homework first, don't just expect others to do it for you. – Chopper3 Aug 02 '12 at 11:38

1 Answers1

1

This is called (in Cisco talk at least) IP Helper-Address.

The network switch acts as a proxy between DHCP requests on the VLAN and your DHCP server.

The network switch will replace the DHCP source address with its own address of the interface on which it received the request.

This is then forwarded onto the DHCP server specified in the ip helper-address.

Since the DHCP server will see the source address (i.e the network switches internal interface subnet) from which the DHCP request came it can allocate from the correct pool.

In windows at least this is just a case of setting up the DHCP server and scopes, sorry this is not Linux specific but I think it would just be a matter of creating pools in dhcpd.

Referencing the man page for dhcpd:

subnet 204.254.239.0 netmask 255.255.255.224 {
  subnet-specific parameters...
  range 204.254.239.10 204.254.239.30;
}

subnet 204.254.239.32 netmask 255.255.255.224 {
  subnet-specific parameters...
  range 204.254.239.42 204.254.239.62;
}

subnet 204.254.239.64 netmask 255.255.255.224 {
  subnet-specific parameters...
  range 204.254.239.74 204.254.239.94;
}
morleyc
  • 1,120
  • 13
  • 45
  • 86