# howto exclude a device from dhcpd.conf

## musv

Hi, 

I'm using my normal computer as a router to forward my internet connection to my notebook. For that reason I installed dhcpd to provide the config to the subnet. The notebook is connected to my computer via eth1. And sometimes I connect something to eth2. From eth0 I get the internet connection by my ISP. That's working all without problems. But one thing is annoying:

```

...

Apr  2 20:10:45 Blechkasten dhcpd: DHCPDISCOVER from 00:0d:87:3a:8e:7d via eth1

Apr  2 20:10:45 Blechkasten dhcpd: DHCPOFFER on 192.168.0.2 to 00:0d:87:3a:8e:7d via eth1

Apr  2 20:11:23 Blechkasten dhcpd: DHCPDISCOVER from 00:0d:87:3a:8e:7d via eth1

Apr  2 20:11:23 Blechkasten dhcpd: DHCPOFFER on 192.168.0.2 to 00:0d:87:3a:8e:7d via eth1

Apr  2 20:11:25 Blechkasten dhcpd: DHCPDISCOVER from 00:0d:87:3a:8e:7d via eth1

Apr  2 20:11:25 Blechkasten dhcpd: DHCPOFFER on 192.168.0.2 to 00:0d:87:3a:8e:7d via eth1

Apr  2 20:11:29 Blechkasten dhcpd: DHCPDISCOVER from 00:0d:87:3a:8e:7d via eth1

Apr  2 20:11:29 Blechkasten dhcpd: DHCPOFFER on 192.168.0.2 to 00:0d:87:3a:8e:7d via eth1

Apr  2 20:11:33 Blechkasten dhcpd: DHCPDISCOVER from 00:0d:87:3a:8e:7d via eth1

Apr  2 20:11:33 Blechkasten dhcpd: DHCPOFFER on 192.168.0.2 to 00:0d:87:3a:8e:7d via eth1

Apr  2 20:11:43 Blechkasten dhcpd: DHCPDISCOVER from 00:0d:87:3a:8e:7d via eth1

Apr  2 20:11:43 Blechkasten dhcpd: DHCPOFFER on 192.168.0.2 to 00:0d:87:3a:8e:7d via eth1

Apr  2 20:11:53 Blechkasten dhcpd: DHCPDISCOVER from 00:0d:87:3a:8e:7d via eth1

Apr  2 20:11:53 Blechkasten dhcpd: DHCPOFFER on 192.168.0.2 to 00:0d:87:3a:8e:7d via eth1

...

```

00:0d:87:3a:8e:7d is my eth0-network-device which is also my external IP. I don't want to offer anything from my dhcp-server to that device. How can I stop that stupidness? How can I exclude eth0 from the range of my dhcpd?

```
ddns-update-style none;

option domain-name "csn.tu-chemnitz.de hrz.tu-chemnitz.de informatik.tu-chemnitz.de";

option domain-name-servers 192.168.0.1;

server-name "blechkasten.csn.tu-chemnitz.de";

option ntp-servers 134.109.102.1;

default-lease-time 43200;

max-lease-time 86400;

# If this DHCP server is the official DHCP server for the local

# network, the authoritative directive should be uncommented.

#authoritative;

# Use this to send dhcp log messages to a different log file (you also

# have to hack syslog.conf to complete the redirection).

log-facility local7;

subnet 192.168.0.0 netmask 255.255.255.0 {

  range 192.168.0.2 192.168.0.254;

  option broadcast-address 192.168.0.255;

  # Gateway

  option routers 192.168.0.1;

  #Feste IP vergeben

  host Fehlermelder {

        hardware ethernet 00:08:74:9A:33:DB;

        fixed-address 192.168.0.250;

  }

}

subnet 192.168.1.0 netmask 255.255.255.0 {

  range 192.168.1.2 192.168.1.254;

  option broadcast-address 192.168.1.255;

  option routers 192.168.1.1;

}

```

----------

## gentoo_ram

It's a command line parameter to the DHCP server.  Look at /etc/conf.d/dhcp

----------

## musv

Thx. I looked into the /etc/conf.d/dhcpd and found the following (default config):

```

# /etc/conf.d/dhcpd: config file for /etc/init.d/dhcpd

# If you require more than one instance of dhcpd you can create symbolic

# links to dhcpd service like so

#   cd /etc/init.d

#   ln -s dhcpd dhcpd.foo

#   cd ../conf.d

#   cp dhcpd dhcpd.foo

# Now you can edit dhcpd.foo and specify a different configuration file.

# You'll also need to specify a pidfile in that dhcpd.conf file.

# See the pid-file-name option in the dhcpd.conf man page for details.

# If you wish to run dhcpd in a chroot, uncomment the following line

# DHCPD_CHROOT="/chroot/dhcp"

# Then run emerge dhcp --config

# All file paths below are relative to the chroot.

# You can specify a different chroot directory but MAKE SURE it's empty.

# Specify a configuration file - the default is /etc/dhcp/dhcpd.conf

# DHCPD_CONF="/etc/dhcp/dhcpd.conf"

# Configure which interface or interfaces to for dhcpd to listen on.

# List all interfaces space separated. If this is not specified then

# we listen on all interfaces.

DHCPD_IFACE="eth1"

# Insert any other dhcpd options - see the man page for a full list.

# DHCPD_OPTS=""

```

The strange thing is: By default it's already limited to eth1. 

I looked into the start-stop-script, but it seems the device are simply written behind the start-command. There seems not to be an option to limit that. (DHCPD_IFACE is the searched parameter)

```

start-stop-daemon --start --exec /usr/sbin/dhcpd \

                --pidfile "${DHCPD_CHROOT}/${pidfile}" \

                -- ${DHCPD_OPTS} -q -pf "${pidfile}" \

                -user dhcp -group dhcp \

                ${DHCPD_CHROOT:+-chroot} ${DHCPD_CHROOT} ${DHCPD_IFACE}

        eend $? \

```

----------

## Hobbes-X

It's been two months, sorry to dig this up. Looks like you're confusing dhcp and dhcpd, like I was...   :Confused: 

EDIT: Dumb, nevermind... logs show the client as dhcpcd, apologies... I guess the confused smiley was appropriate   :Wink: 

----------

