# dhcpd + dhcrelay



## schmurfy (Jul 5, 2010)

Hello,
I have a strange problem ( another one  ), i have a box routing traffic from a lan to a wan, what i want to achieve is to serve some local clients an ip with dhcpd and use dhcrelay for the others.

Here is how i tried to do that: i setup a virtual interface with netgraph receiving only the packets i want to be relayed and the others go to the upper hook of the lan interface as if notving happened. This part is what works, (tested with tcpdump) i have my network and my nodes working the way i want them to, after reaching that point i thought nothing could go wront but...

I tried to start dhcpd on the lan interface and dhcrelay on ngeth0 and wan interface but dhcrelay wont start and throw an error saying the address is already in use, how is that even a possible answer ?

It seems to know that the lan and ngeth0 interfaces are somehow connected and that is what bother me, i tried to bind dhcrelay only on ngeth0, same error. I tried some config tweak but nothing seems to work.
I can always start one or the other on ngeth0 or lan but never both at the same time.


----------



## SirDice (Jul 8, 2010)

schmurfy said:
			
		

> I tried to start dhcpd on the lan interface and dhcrelay on ngeth0 and wan interface but dhcrelay wont start and throw an error saying the address is already in use, how is that even a possible answer ?


Both will try to bind the same ports on all interfaces. Bind each to their own interface.


----------



## schmurfy (Jul 8, 2010)

that does not work (at least not for me), I don't really know how they bind but on a freebsd host you cannot run both together (it works on linux by the way).
I managed to solve the problem by replacing isc-dhcrelay by dhcrelya from the ports, works perfectly like that.


----------

