Passing Interface Name to Event Script

Rick Solotke RSolotke at
Mon Nov 16 19:06:40 UTC 2009


Thanks for the response.  The issue is that the client is only available
through one interface, not any (each client is directly connected to one
interface).  So your solutions (at least numbers 2 and 3) will not solve
the problem in this case.

At this point, I believe that in my specific situation, it makes more
sense to assign different address ranges (still in the same subnet) for
dhcpd to assign to each interface than to continue struggling to make
this fully automated.

I appreciate your time and input.


-----Original Message-----
From: dhcp-users-bounces at
[mailto:dhcp-users-bounces at] On Behalf Of Glenn Satchell
Sent: Saturday, November 14, 2009 4:26 AM
To: dhcp-users at
Subject: Re: Passing Interface Name to Event Script

>Subject: Passing Interface Name to Event Script
>Date: Fri, 13 Nov 2009 16:40:09 -0800
>Content-class: urn:content-classes:message
>Thread-Topic: Passing Interface Name to Event Script
>From: "Rick Solotke" <RSolotke at>
>To: <dhcp-users at>
>X-BeenThere: dhcp-users at
> Hello,
> I have dhcpd running on a router with several network interfaces, all
> which belong to the same subnet.  Because all interfaces belong to the
> same subnet, the Linux routing table is ambiguous (an address on the
> subnet is reachable via more than one interface).  Consequently, once
> DHCP transaction completes, the router and the new client are unable
> communicate until a static route is added to the router's routing
> This route specifies the specific IP address of the client and the
> interface on which that address is accessible (e.g. route add
> dev eth0).  If I manually enter the route at the command
> line, the router and client are then able to communicate happily.
> I'd like to automate this process, so that as soon as the DHCP
> transaction occurs, the static route is automatically added.  The
> COMMIT event seems to be the right place to do this, and I am able to
> make the IP address available to the script.  However, I see no way to
> make the interface name available to the script.  Without the
> name, the script is unable to add the static route.
> Any suggestions?  dhcpd obviously knows which interface the DHCP
> transaction occurred on, but is there any way that information can be
> made available to the event script?  If not, does anyone have a
> suggestion for another way to accomplish assignment of the static
> upon DHCP completion?

This is really a Linux routing issue, not a DHCP problem as such.

If the client is available through any interface then I can think of
three possibilities:

1. Run a dynamic routing protocol and let it sort out which interface
to route through.

2. In the script assign the interface for the route on a round-robin or
pseudo random basis. As long as the routes are pretty evenly
distributed you should be ok.

3. If the DHCP traffic is not too high route all the DHCP traffic
through one interface and leave the others for other traffic.


dhcp-users mailing list
dhcp-users at

More information about the dhcp-users mailing list