New expression keyword for matching on interface name

Oskar Berggren oskar.berggren at gmail.com
Tue May 26 13:09:19 UTC 2009


Hi,

I'm currently experimenting with having a DHCP server provide
ip-addresses from the same subnet to clients on different physical
networks, connected to the DHCP server using multiple network
interfaces. This is useful when you want to limit traffic between
connected hosts, but don't want to allocate a real subnet per host,
due to the extra waste of ip-addresses.

I also want to assign different addresses to client hosts depending on
which interface the request comes in on. I believe one way of doing
this would be using dhcprelay, setting circuit-id, and passing on to
an external DHCP-server, which classifies based on the circuit-id.
However, in this case it would be preferable if the DHCP-server ran on
the router itself.

The latter is a problem, since I haven't found a way to configure the
DHCP server to classify based on the network interface involved. To
solve this issue I have written a patch that introduces the keyword
"interface-name" for use in expressions.

Is there already a different way of doing this, which I'm not aware of?

Is ISC interested in applying the patch to the official distribution
if I submit it?


Example of using interface-name:

This enables me to do this:

On the router/DHCP server:
    Interfaces:
        eth0 10.80.0.1/32
        eth1 10.80.0.1/32
        ...

For DHCPd:
    class "host1" {
        match if interface-name = "eth0";
    }
    class "host2" {
        match if interface-name = "eth1";
    }
    subnet 10.80.0.0 netmask 255.255.255.0 {
        pool {
            allow members of "host1";
            range 10.80.0.10;
        }
        pool {
            allow members of "host2";
            range 10.80.0.11;
        }
    }
    on commit {
        execute ("/etc/dhcp3/on-commit-hook", interface-name,
                 binary-to-ascii(10, 8, ".", leased-address));
    }


/Oskar



More information about the dhcp-hackers mailing list