# dhcpd: "No subnet declaration for eth1"

## Sanderfox

Yesterday I updated to the new baselayout-2 and openrc and since then I can't get dhpcd to work anymore. It keeps saying the same message: 

 *Quote:*   

> No subnet declaration for eth1 (192.168.1.1).
> 
> ** Ignoring requests on eth1.  If this is not what
> 
>    you want, please write a subnet declaration
> ...

 

I have searched around, but none of the solutions (if any) seem to work.

I have set up a static ip for eth1 by putting 'config_eth1="192.168.1.1 netmask 255.255.255.0"' in /etc/conf.d/net.

This is my dhcpd.conf:

 *Quote:*   

> # dhcp.conf
> 
> # option definitions common to all supported networks...
> 
> option domain-name "internal";
> ...

 

Does anyone have a clue what's wrong here? I had it working before without any problems.

----------

## Maliwik

Is that just for a LAN connection, or are you trying to connect directly to the Internet?

----------

## pingu

You have declared the subnet as 192.168.0.0/24 but the interface is on 192.168.1.0/24. That's not gonna work.

----------

## Sanderfox

I'll explain what I'm trying to do.

My computer is connected to the internet with eth0. On eth1 I have a wlan router connected so I can use my laptop as well. I gave eth1 192.168.1.1 as static ip and I set up dhcpd to give the router something between 192.168.0.2 and 192.168.0.99. I also had connection sharing on using Firestarter.

It worked before, but now for some reason it doesn't work anymore. I hope this info helps.

----------

## bradp_84

Is your computer acting as the Internet gateway? If so, you need to replace the subnet declaration in your dhcpd.conf to the following:

```

subnet 192.168.1.0 netmask 255.255.255.0 {

range 192.168.1.2 192.168.1.99;

option routers 192.168.1.1;

option broadcast-address 192.168.1.255;

}

```

Don't for to enable ip forwarding: echo 1 > /proc/sys/net/ipv4/ip_forward

Or even better, add it to /etc/sysctl.conf

Cheers,

Brad

----------

## Sanderfox

I solved the problem. I'm now using dnsmasq instead of dhcpd, and I'm now using iptables to forward the internet connection instead of Firestarter. I followed this guide: http://gentoo-wiki.com/HOWTO_setup_a_home-server.

----------

