Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
howto exclude a device from dhcpd.conf
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
musv
Advocate
Advocate


Joined: 01 Dec 2002
Posts: 3369
Location: de

PostPosted: Wed Apr 02, 2008 6:19 pm    Post subject: howto exclude a device from dhcpd.conf Reply with quote

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:

/var/log/messages:

...
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?

dhcpd.conf:
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;
}
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 515
Location: San Diego, California USA

PostPosted: Wed Apr 02, 2008 10:48 pm    Post subject: Reply with quote

It's a command line parameter to the DHCP server. Look at /etc/conf.d/dhcp
Back to top
View user's profile Send private message
musv
Advocate
Advocate


Joined: 01 Dec 2002
Posts: 3369
Location: de

PostPosted: Wed Apr 02, 2008 11:14 pm    Post subject: Reply with quote

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

# /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)
/etc/init.d/dhcpd:

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 $? \
Back to top
View user's profile Send private message
Hobbes-X
l33t
l33t


Joined: 04 Feb 2004
Posts: 823
Location: Seattle, WA

PostPosted: Sat May 31, 2008 2:12 am    Post subject: Reply with quote

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

EDIT: Dumb, nevermind... logs show the client as dhcpcd, apologies... I guess the confused smiley was appropriate :wink:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum