Client classification based on device name. It is possible?

Алексей Прокопчук alexpro at homelan.lg.ua
Fri Jul 6 14:31:07 UTC 2012


06.07.2012 14:43, Simon Hobson пишет:
> You need to clarify your setup a bit - I can interpret your
> description two ways. BTW - it's not a problem with your English,
> that's fine.
>
> Do you have something like this :
>
> eth0 192.168.1.1/24
> eth1 192.168.2.1/24
> eth2 192.168.3.1/24
>
> and
>
> shared-subnet ...
>   subnet 192.168.1.0 ...
>   subnet 192.168.2.0 ...
>   subnet 192.168.3.0 ...
> }
>
> and when you connect a client to the eth0 network, it gets an address
> from the 192.168.2.0/24 subnet ?
>
>
>
> Or do you have something like this :
>
> eth0 192.168.1.1/24 eth0:1 192.168.2.1/24
> eth1 192.168.3.1/24 eth1:1 192.168.2.1/24
> eth2 192.168.5.1/24 eth2:1 192.168.2.1/24
>
> and
>
> shared-subnet ...
>   subnet 192.168.1.0 ...
>   subnet 192.168.2.0 ...
> }
> shared-subnet ...
>   subnet 192.168.3.0 ...
>   subnet 192.168.4.0 ...
> }
> shared-subnet ...
>   subnet 192.168.5.0 ...
>   subnet 192.168.6.0 ...
> }
>
> And you need to put some devices in (eg) 192.168.1.0 and some in
> 192.168.2.0 ?
>
Thanks for reply.

Here is simplified configuration example:

eth0 - don't used by dhcpd

eth1 (no IP address, master for 802.1Q VLANs)

eth1.21 10.0.0.0/16; 192.168.0.0/26
eth1.22 10.1.0.0/16; 192.168.0.64/26
eth1.23 10.2.0.0/16; 192.168.128.0/26
eth1.24 10.3.0.0/16; 192.168.192.0/26

And also, I don't have subinterfaces like eth.21:0 etc. I use multiple
IP addresses for same interface.
Like that:
# ip addr show dev eth1.21
eth1.21 at eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc htb state UP
    link/ether 00:1b:21:4f:25:85 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.0/16 brd 10.0.255.255 scope global eth1.21
    inet 192.168.0.1/26 brd 192.168.0.63 scope global eth1.21

And dhcpd.conf:

shared-network alexpro
{
 #VLAN21 unknown MAC-addresses
 subnet 192.168.0.0 255.255.255.192
 {
   pool
  {
   allow unknown-clients;
   range 192.168.0.2 192.168.0.62;
  }
 }
 
 #VLAN22 unknown MAC-addresses
 subnet 192.168.0.64 255.255.255.192
 {
   pool
  {
   allow unknown-clients;
   range 192.168.0.66 192.168.0.126;
  }
 }

 #VLAN21 known MAC-addresses
 subnet 10.0.0.0 255.255.0.0
 {
   deny unknown-clients;
  
   host m1
   {
     hardware ethernet 00:01:02:03:04:05;
     fixed-address 10.0.0.5;
   }
 }
 
 #VLAN22 known MAC-addresses
 subnet 10.1.0.0 255.255.0.0
 {
   deny unknown-clients;

   host m2
   {
     hardware ethernet 00:06:07:08:09:0a;
     fixed-address 10.1.0.10;
   }
 }
 
 ... and so on.
}

And, if request arrived from eth1.22, server offers IP address from pool
of 192.168.0.0/26 subnet, which is belongs to eth1.21.



More information about the dhcp-users mailing list