Author

Christopher Marshall (christopherlmarshall@yahoo.com)

Raw Notes on DHCP

# dhcp client
/sbin/dhcpcd
# running this bare will send a dhcp request on eth0
dhcpcd
# you can specify an interface like this
dhcpcd eth1
# running it in test mode like this
dhcpcd -T eth1
# -d causes it to write every action to the syslog
dhcpcd -d
# causes it to gather the config information in the following file:
/etc/dhcpc-eth1.info
# the contents of such a file would look like this:
IPADDR=192.168.15.101
NETMASK=255.255.255.0
NETWORK=192.168.15.0
BROADCAST=192.168.15.255
GATEWAY=192.168.15.1
DNS=192.168.15.1
DHCPSID=192.168.15.1
DHCPGIADDR=0.0.0.0
DHCPSIADDR=0.0.0.0
DHCPCHADDR=00:90:47:03:B9:58
DHCPSHADDR=00:12:17:B2:35:1F
DHCPSNAME=''
LEASETIME=86400
RENEWALTIME=43200
REBINDTIME=75600
INTERFACE='eth1:0'
CLASSID='Linux 2.4.24 i686'
CLIENTID=00:90:47:03:B9:58
# you would typically use IP aliasing with the T flag on an interface you already had
# an IP assignment on, like this
dhcpcd -T eth1:0

# sometimes dhcpcd stays running and sometimes it exits after getting the assignment.
# the proper way to kill a running client is this:
dhcpcd -k

# dhcp server slackware package
/var/adm/packages/dhcp-3.0.4

# protocols implemented
BOOTP
DHCP

# components
/usr/sbin/dhcpd
/etc/dhcpd.conf
/etc/dhcpd.leases
/var/run/dhcpd.pid

# man pages
dhcpd
dhcpd.conf

# command line
dhcpd <list of eth devices to listen on>
# flags
-cf <alternate config file>
-lf <alternant lease file>
-pf <alternate lease file>
-f (run in the foreground)
-d (write log info to stderr instead of to syslog)
-q (don't print the annoying copyright message)
-t (test config file for correct syntax)

# dhcpd.conf syntax
# DHCP clauses
subnet 10.0.1.0 netmask 255.255.255.0 {
   range 10.0.1.1  10.0.1.20;
   range 10.0.1.30 10.0.1.40;
   default-lease-time 600;
   max-lease-time 6000;
   option routers 10.0.1.1;
   option domain-name "example.net";
   option domain-name-servers 10.0.1.1, 10.0.1.2;
}
how do you specify an infinite lease time?
is the router the "default gw" for the subnet?
what if you want to specify a router for another subnet?

# BOOTP clauses
host host1 {
   hardware ethernet 00:aa:00:bb:00:00
   fixed-address 10.0.1.5
   filename "tftpboot/host1.boot"
}



hopeless_linux: RawNotes/dhcp (last modified 2007-07-01 16:01:00)