A Linux User Reference

Search tips
  • search ignores words that are less than 4 characters in length
  • searches are case insensitve
  • if a search does not return anything try it in Boolean mode then Query expansion mode by checking the appropriate radio button e.g. searching for 'cron' in just the Administration category returns nothing - presumably because the 50% threshold is reached. Boolean mode ignores this threshold so a search for 'cron' returns several hits
  • in Boolean mode preceding a word with a '+' means the result must include that word, a '-' means it must not
  • in Boolean mode '+crontab -anacron' means match articles about crontab that DO NOT mention anacron
  • to match a phrase e.g. 'manage system' check the Boolean mode radio button and enclose the phrase in quotes "some phrase ..."
  • in Query expansion mode the search context is expanded beyond the keywords you entered - relevancy of hits may well be degraded



  • DHCP server

    The Dynamic Host Configuration Protocol(DHCP) allows multiple network clients to receive their network configuration parameters from a single source thus simplifying this aspect of network administration for medium to large networks.

    • a DHCP server manages the allocation of IP addresses to clients
    • an IP address is leased to the client
    • the lease determines for how long a client may /use the IP address it has been allocated
    • leases are stored in the database file /var/lib/dhcp/dhcpd.leases
    • a server will also provide a number of network configuration parameters
    • server configuration file is /etc/dhcpd.conf or /etc/dhcp3/dhcpd.conf

    Reserved bootp entries - /etc/services

    # Format: <application> <port/protocol> 
    bootps  67/tcp  # BOOTP server
    bootps  67/udp
    bootpc  68/tcp  # BOOTP client
    bootpc  68/udp
  • Server configuration with dns-updates

    Sample configuration for an internal lan

    # Global settings
    # DHCP allows the client to receive options from the DHCP server describing the network
    # configuration and various services that are available on the network.
    option domain-name "";
    option domain-name-servers,;
    option routers;
    option broadcast-address;
    default-lease-time 3600;               # if a client does not ask for a specific period
    max-lease-time 7200;                   # max period in seconds that a lease will last
    log-facility local7;                   # use this syslog/rsyslog facility
    ignore-client-updates;                 # ignore all client requests for DDNS update
    authoritative;                         # this is the official dhcp server for
    # Settings here override global ones
    # Subnet with dynamic dns updates
    subnet netmask {     
       ddns-update-style interim;
       ddns-ttl 14400;
       ddns-updates on;
       key "dhcp-updates" {
         algorithm hmac-md5;
         secret "iTgkclA........wA==";
       zone {                  # ddns-domainname "";
         primary;                 # name server whose zone information is to be updated. 
         key "dhcp-updates";
        zone {      # ddns-rev-domain "";
         key "dhcp-updates";

    If entry in /etc/syslog.conf or /etc/rsyslog.d/50-default.conf is

    local7.*                   /var/log/dhcp/dhcpd.log

    may clash with boot messages in some distributions.

    then a sample lease log entry in /var/log/dhcp/dhcpd.log

    Lease  {                   # A sample log entry
     starts  5  2008/01/02   10:53:18;

    You can do all sorts of things with 'rsyslog' so record format could be well different.

  • Further server configuration examples

    Use 'man dhcp-options' to find out more.

    A client's boot parameters are determined by consulting

    • that client's host declaration (if any) and then
    • consulting any class declarations matching the client
    • followed by the pool, subnet and shared-network declarations for the IP address assigned to the client
    # Global parameters
    option smtp-server;
    option pop-server;
    option nntp-server;
    option time-servers;
    # single host with static address NOT in pool/range
    host fantasia {
         hardware ethernet 08:00:07:26:c0:a5;
         option routers;
         option netmask;
         option broadcast-address;
    # Clients can be separated into classes, and treated differently depending on what
    # class they are in. This separation can be done either with a conditional statement, 
    # or with a match statement within the class declaration.
    # ----
    # Assigns a class of 'foo' to host if it is a Sun Workstation
    class "foo" {
         match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
    # used to inform the DHCP server that some IP subnets actually
    # share the same physical network
    shared-network 224-29 {
         subnet netmask {
         option routers;
    subnet netmask {
         option routers;
    # The pool declaration can be used to specify a pool of addresses that will be treated
    # differently than another pool of addresses, even on the same network segment or subnet.
    # ----
    # Using pools you can subdivide the available IP range e.g. members
    # of group foo get a subset of addresses that are available
    pool {
         allow members of "foo";
    pool {
         deny members of "foo";
    # Use a group statement to provide common parameters for a set of hosts
    group {
      # group-specific parameters...
      host {
        host-specific parameters...
      host {
        host-specific parameters...
      host {
        host-specific parameters...
    Some 'kind of' rules

    If clients on a subnet are to be assigned addresses dynamically, a 'range' declaration must appear within the subnet declaration.

    For clients with statically assigned addresses or for installations where only known clients will be served, each such client must have a 'host' declaration.

    If parameters are to be applied to a group of declarations which are not related strictly on a per-subnet basis, the 'group' declaration can be used.

    A subnet declaration is required for each subnet even if no addresses will be dynamically allocated on that subnet.

  • DHCP server daemon

    By default 'dhcpd' listens on all configured interfaces.

    dhcpd [-p <UDP port>]
          [-cf conffile]
          [-lf leasefile]
          [-s server]
          [if0 ...]
     -t | -T            Test the lease DB but do not carry out any operations
     -f                 Do not fork
     -d                 Debug, log to stdout, '-f' is implied
     -q                 Quiet, do not print out copyright message etc. on startup

    Reload the DHCP-server after making changes

    # /etc/init.d/dhcp restart

    Probably via 'sudo service dhcp [command]' as well ...

  • PXE boot server
    • Pre-boot eXecution Environment.
    • Enables booting of a remote system over a network.
    • The remote system gets it's network configuration via DHCP and a kernel boot image via tftp.

    Example configuration (for a single PC) - /etc/dhcpd.conf

    # If /etc/ltsp/dhcpd.conf exists it will take precedence
    # GLOBAL
    ddns-update-style none;                                     # Not using
    deny booting;                                               # Use PXE - default=allow
    deny bootp;                                                 # Use PXE - default=allow
    default-lease-time 600;
    max-lease-time 7200;
    authoritative;                                              # Only dhcp on subnet
    log-facility local7;                                        # Logging
    option domain-name-servers,;    # ISP's nameservers
    # SUBNET
    subnet netmask {                  # My internal lan
         range;                        # allocate an IP from this range
         option broadcast-address;
         option routers;
    # used to apply one or more parameters to a group of declarations
    # It can be used to group hosts, shared networks, subnets, or even other groups
    group {
         host ubtest {
              allow booting;                                    # This host can net boot
              allow bootp;
              server-name "ubuntusrv";                          # Sent to client, name of server it is booting from
              next-server;                          # Get boot image from this server
              hardware ethernet 00:0f:ea:cb:7a:c4;
              filename "pxelinux.0";                            # Use this boot image (/var/lib/tftpboot/..)
              fixed-address;                        # Cannot be in range of dynamic ip allocation
  • DHCP relaying

    If a client were able to connect to the DHCP-server through a router, the DHCP-server would see the router's NIC address not the client's. This means the server cannot recognise the client via it's hardware (MAC) address.

    A relay, relays broadcasts on one subnet to a server on another and returns the responses back to the client.

  • DHCP and BOOTP relay agent
    • A dhcp-relay agent, provides a means for relaying DHCP and BOOTP requests from subnets to the DHCP-server.
    • It runs in the foreground until it has configured an interface then goes into the background.
    dhcrelay [options] server0 ...
    Some options:
     -p port               Listen and transmit on a non-standard port -standard port is 67
     -d                    Run in the foreground
     -q                    Usually prints network configuration on startup, disable with '-q',
                           useful for startup scripts.
     -i if0 [-i ifN ...]   Interface(s) to listen on

    Relay dhcp requests arriving on eth0 to server

    # dhcrelay -i eth0

    Forward client traffic to server(s) listed on the command line.

  • Client DHCP configuration
    • The DHCP protocol allows the client to request only the information it wants.
    • Clients can reject offers from servers if they don't contain information the client needs or if the information provided is not satisfactory.
    • Clint configuration via /dhclient.conf file in /etc/dhcp/ or /etc/dhcp3/.
    • There are a number of parameters/options that determine a client's behaviour.

    Configuration considerations:

    • protocol timing
    • information requested from the server
    • information required of the server
    • defaults to use if the server does not provide certain information
    • values with which to override information provided by the server
    • values to prepend or append to information provided by the server
    • can also be pre-initialised with addresses to use on networks that don't have DHCP servers

    There are a number of available clients. 'dhclient' and 'dhcp' is ISC's software. It is the most widely used open source DHCP implementation on the Internet. The name used to include the version number but since version 3 this is no longer appears to be the case.

  • Client DHCP statements
    request, require, send
    Request statement

    Requests any responding server to send the values for the options specified in the request statement. The server has values for these options configured in it's *dhcpd.conf' file.

    request [ option ] [, ... option ];

    Sample request - /etc/dhcp3/dhclient.conf

    request;              # Request values for all available options

    Probably 'dhcp' and not 'dhcp3'.

    Default request options are: subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, host-name

    Require statement

    A list of options that are required to be sent by the server if it's offer is to be accepted, if not supplied the offer is ignored.

    require [ option ] [, ... option ];
    Send statement

    Send the stated option values to the server - override the server's default values.

    Commonly used to request a lease time where the 'requested-lease-time' is greater than the default 'default-lease-time' (2hrs) and to differentiate the client from other clients.

    send { [ option declaration ] [, ... option declaration ]}

    All options are specified in the 'dhcp-options' man-page.

  • DHCP client program

    Dynamic Host Configuration Protocol client.

    $ dhclient --help
    Internet Systems Consortium DHCP Client 4.2.4
    Copyright 2004-2012 Internet Systems Consortium.
    All rights reserved.
    For info, please visit
    Usage: dhclient [-4|-6] [-SNTP1dvrx] [-nw] [-p <port>] [-D LL|LLT]
                    [-s server-addr] [-cf config-file] [-lf lease-file]
                    [-pf pid-file] [--no-pid] [-e VAR=val]
                    [-sf script-file] [interface]
    Some options:
     -r             Release IP
     -d             Force dhclient to run as a foreground process.
     -x             Stop the client without releasing the current lease.

    Sample client configuration - /etc/dhcp3/dhclient.conf

    # Consists of a request statement followed by ',' separated list of information
    # the client desires from the server.
    request subnet-mask, broadcast-address, time-offset, routers, \
    domain-name, domain-name-servers, host-name, ntp-servers;

    Probably 'dhcp' and not 'dhcp3'.

  • Client leases

    Lease files location - /var/lib/dhcp3/

    dhclient.eth0.leases  dhclient.eth1.leases  dhclient.leases
    dhclient.wlan0.leases  dhcpd.leases

    Probably 'dhcp' and not 'dhcp3'.

    **Sample lease file - /var/lib/dhcp3/dhclient.eth0.leases

    lease {
      interface "eth0";
      option subnet-mask;
      option routers;
      option dhcp-lease-time 946080000;
      option dhcp-message-type 5;
      option domain-name-servers;
      option dhcp-server-identifier;
      option domain-name "";
      renew 0 2020/11/1 02:24:58;
      rebind 5 2035/5/4 01:38:31;
      expire 2 2038/1/19 03:14:07;

    Probably 'dhcp' and not 'dhcp3'.