DHCP Server Configuration

ImageStream Linux version 4.2.7 includes support for the Dynamic Host Control Protocol (DHCP). DHCP allows a router to automatically assign dynamic IP addresses from address pools to DHCP clients.
DNS Servers: 192.168.0.10, 192.168.0.11
DHCP Pool Range: 192.168.0.20 - 192.168.0.254

====ETHERNET===================== 192.168.0.0/24 ===
        |
        | LAN IP: 192.168.0.1
+-------+--------+
|                |
|    Router      |
|                |
+-------+--------+

Before You Start

Be sure to have a list of IP addresses for clients that do not use DHCP for IP address assignment. Thes IP addresses will need to be excluded from the pool to prevent duplicate IP address assignment.

These IP network addresses are given to you by your Internet Service Provider, your leased line carrier, or by ARIN. If you do not plan to connect you network to the Internet, you can use an IP network address set aside for private use. The IP network address for private use can be found in RFC 1597. Most people will use 192.168.0.0 as we have in this example.

Configuration Example

In this example, we are going to assume the following:
  • The router has an Ethernet IP address of 192.168.0.1 with a netmask of 255.255.255.0 .
  • The router will assign IP addresses from 192.168.0.20 through 192.168.0.254 (exclude addresses .1 through .19).
  • The IP address lease time will be 12 hours.
  • The clients will use 192.168.0.1 as the default gateway (default router).
  • The clients will use 192.168.0.10 and 192.168.0.11 as DNS servers.
  • The clients will use imagestream.com as their domain name.
The IP addresses used in this Technical Note are examples only. You will need to use an IP network given to you by your Internet Service Provider.

Router Interface Configuration

!
version 2.00
!
interface Ethernet0
 ip address 192.168.0.1 255.255.255.0
!
ip dhcp pool 0
 network 192.168.0.0 255.255.255.0
 ip dhcp excluded-address 192.168.0.1 192.168.0.19
 domain-name imagestream.com
 dns-server 192.168.0.10 192.168.0.11
 default-router 192.168.0.1
 lease 12 hours
! 
end

Advanced Configuration Example

In this example, we are going to assume the following:
  • The router has an Ethernet IP address of 192.168.0.1 with a netmask of 255.255.255.0 .
  • The router will assign IP addresses from 192.168.0.20 through 192.168.0.254 (exclude addresses .1 through .19).
  • The IP address lease time will be 10 minutes.
  • The clients will use 192.168.0.1 as the default gateway (default router).
  • The clients will use 192.168.0.10 and 192.168.0.11 as DNS servers.
  • The clients will use imagestream.com as their domain name.
  • The clients will use 192.168.0.12 as their NetBIOS server.
  • A client with the MAC address 00:30:64:02:AF:CC will be assigned 192.168.0.35.
  • A client with the MAC address 00:30:61:12:00:09 will be assigned 192.168.0.36.
The IP addresses used in this Technical Note are examples only. You will need to use an IP network given to you by your Internet Service Provider.

Router Interface Configuration

!
version 2.00
!
interface Ethernet0
 ip address 192.168.0.1 255.255.255.0
!
ip dhcp pool 0
 network 192.168.0.0 255.255.255.0
 ip dhcp excluded-address 192.168.0.1 192.168.0.19
 domain-name imagestream.com
 dns-server 192.168.0.10 192.168.0.11
 default-router 192.168.0.1
 lease 10 minutes
 netbios-name-server 192.168.0.12
 netbios-node-type h-node
 host 192.168.0.35 hardware-address 00:30:64:02:AF:CC
 host 192.168.0.36 hardware-address 00:30:61:12:00:09
! 
end

Troubleshooting

Configuration errors will be displayed in the router's event log (syslog). Enable event logging to obtain troubleshooting information from the router. For more detailed information a "ip dhcp debug" command can be used to enable detailed transaction logging for each client. This information will be logged to the router's event log.

Advanced users can use the following command from the command prompt to view all DHCP traffic on all interfaces:

ImageStream:/usr/local/sand# tcpdump -n -s0 -v -e -i Ethernet0 port 67 or port 68

Command description:
  • tcpdump: Program used to capture and display packets
  • -n: Don't resolve IP addresses to DNS names
  • -s0: Capture the entire packet - provides more information when used with -v
  • -v: Verbose - provide as much information as possible
  • -e: Display the ethernet MAC addresses
  • -i Ethernet0: Capture on the Ethernet0 interface.
  • port 67 or port 68: Capture only packets on the DHCP ports

Sample output:
    tcpdump: listening on Ethernet0
    23:03:14.706036 0:90:fb:9:20:4f ff:ff:ff:ff:ff:ff 0800 590: 0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] xid:0xb01cc42b vend-rfc1048 DHCP:DISCOVER CID:[ether]00:90:fb:09:20:4f VC:"udhcp 0.9.9-pre2" PR:SM+DG+NS+HN+DN+BR+YD+YS+NTP (ttl 64, id 0, len 576)
    23:03:15.000739 0:e:c:a9:f8:cb 0:90:fb:9:20:4f 0800 342: 192.168.0.1.67 > 192.168.0.254.68: [udp sum ok] xid:0xb01cc42b Y:192.168.0.254 vend-rfc1048 DHCP:OFFER SID:192.168.0.1 LT:43200 SM:255.255.255.0 DG:192.168.0.1 NS:192.168.0.10,192.168.0.11 DN:"imagestream.com" [tos 0x10] (ttl 16, id 0, len 328)
    23:03:15.001078 0:90:fb:9:20:4f ff:ff:ff:ff:ff:ff 0800 590: 0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] xid:0xb01cc42b vend-rfc1048 DHCP:REQUEST CID:[ether]00:90:fb:09:20:4f VC:"udhcp 0.9.9-pre2" RQ:192.168.0.254 SID:192.168.0.1 PR:SM+DG+NS+HN+DN+BR+YD+YS+NTP (ttl 64, id 0, len 576)
    23:03:15.001244 0:e:c:a9:f8:cb 0:90:fb:9:20:4f 0800 342: 192.168.0.1.67 > 192.168.0.254.68: [udp sum ok] xid:0xb01cc42b Y:192.168.0.254 vend-rfc1048 DHCP:ACK SID:192.168.0.1 LT:43200 SM:255.255.255.0 DG:192.168.0.1 NS:192.168.0.10,192.168.0.11 DN:"imagestream.com" [tos 0x10] (ttl 16, id 0, len 328)
Technical Support
Home >
Technical Notes >
DHCP Server Configuration

Software Versions

General Availability
(GA) Releases


Envoy: 4.4.1-30
Others: 4.4.1-30
IDCA:

ICNA Certification


Get Your
ImageStream
Certification