# DHCP server in dnsmasq not working (SOLVED)

## Sarpy Sam

I have been trying to follow 

http://www.gentoo.org/doc/en/home-router-howto.xml#doc_chap5

Home router guide and not having much luck.  I cannot get the DHCP server running.

The local network is on eth2

 *Quote:*   

> /etc/conf.d/net:
> 
> config_eth2=( "192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0" )

 

 *Quote:*   

> /etc/dnsmasq.conf
> 
> listen-address=192.168.0.1
> 
> dhcp-range=192.168.2.100,192.168.2.125,72h

 

I start eth2, /etc/init.d/net.eth2 start, and it runs fine and ifconfig shows that it is up.  I then start dnsmasq, /etc/init.d/dnsmasq start, with no errors.  When I try to get an external computer to get a address from the the server I only get an error saying there is no dhcp server on network.  I have completely turned off the firewall while trying to get this to work in case that was somehow the problem.  What am I doing wrong here?  I can't seem to figure out the problem.  Thanks for any help.Last edited by Sarpy Sam on Sun Apr 30, 2006 2:53 am; edited 1 time in total

----------

## think4urs11

 *Sarpy Sam wrote:*   

>  *Quote:*   /etc/conf.d/net:
> 
> config_eth2=( "192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0" ) 
> 
>  *Quote:*   /etc/dnsmasq.conf
> ...

 

You try to serve dhcp addresses from an ip range *not* beeing the same as the interface is in, thats why it won't work.

Either change the dhcp-range to be 192.168.0.x-y or configure a dhcp relay agent for .2.x which then does whats needed to forward/convert the dhcp requests between requests coming from .2.x towards the server on .0.1 and vice versa. (broadcast/unicast conversion, populating GIADDR and alike)

----------

## Sarpy Sam

I changed the listen address to 192.168.2.1 and the eth2 to 192.168.2.1 and it did no good.  I still can't get the dhcp to give another computer an ip address.  I give, I don't know what to do at this point.

----------

## Sarpy Sam

Ok, I get it.  I emerge dhcp which gave me decent log files to trouble shoot with.  The whole problem is the ip address to the netmask to the broadcast matching up.  Can anybody point out a good tutorial on this that an idiot like me can understand.  So far everything I find confuses me.

----------

