VLAN & DHCP server

Simon Hobson dhcp1 at thehobsons.co.uk
Mon Dec 17 07:51:09 UTC 2007


Suhaime Raeze wrote:
>im trying to understand the whole process of how clients from 
>various vlan receive the dhcp signal from one server..Ive read 
>somewhere that scopes are needed can anybody elaborate more on that?

Let me repeat, you do NOTHING special to the DHCP service config to 
support VLANS. With VLANs, you consider each VLAN id as though it 
were a physically separate network and configure the DHCP server 
accordingly.

The trick is to remember that on a VLAN enabled switch, you have two 
sorts of ports :

1) On an untagged port, only traffic to/from a particular VLAN id is 
carried on that port - so it behaves as though all the other VLANs 
don't exist.

2) On a tagged port, the packets carry an additional header with the 
VLAN id - this header is decoded at the driver level* and used to 
split the packets into different streams as though they came from 
different physical NICs.

* Actually it's further up into the Kernel, but if you work with that 
conceptually it will make it easier to understand.


So, on a Linux based system, suppose you want to support 3 VLANs with 
IDs 101, 102, 103. You might end up with four interfaces - eth0, 
eth0.101, eth0.102, eth0.103. DO NOT confuse these with secondary IP 
addresses where you would have interfaces like eth0:0 - these eth0.n 
interfaces really do behave like separate physical NICs.

I think this is possibly where people get confused. If you want to 
run multiple subnets on one network, then broadcasts are a problem 
because they will all 'come in' on the same base i/f (eg eth0 even 
though the subnet is assigned to eth0:0). With VLANs this does not 
happen, a broadcast on VLAN101 will be received on i/f eth0:101 for 
example.


So ALL you need to do is :

- Configure VLAN support on the server and connect it with a tagged 
port on the switch.

- Configure each subnet in the DHCP server.

The rest is automagic.


A google search for "linux vlan howto" will get you loads of 
resources, in particular this one 
(http://www.linuxjournal.com/article/7268) gives a good intro.


More information about the dhcp-users mailing list