Using DHCP


This document describes OpenROUTE Networks Dynamic Host Configuration Protocol (DHCP) implementation for both the DHCP client and the DHCP server and includes the following sections:

DHCP Overview

Configuring DHCP Client

DHCP Client Commands

Configuring DHCP Server

DHCP Server Commands

DHCP Overview

Dynamic Host Configuration Protocol (DHCP) is an Internet standard for passing configuration information, including Internet Protocol (IP) addresses, to hosts on a Transmission Control Protocol/Internet Protocol (TCP/IP) network. DHCP is an extension of the BOOTstrap Protocol (BOOTP), adding the capability of automatic allocation of reusable network addresses. When you configure your OpenROUTE Networks router to use DHCP, you enable dynamic, centralized management of the IP addresses on your local internet so you no longer need to assign and track IP addresses manually.

The OpenROUTE Networks DHCP implementation allows an OpenROUTE router LAN interface to be either a DHCP client or a DHCP server, but not both simultaneously.

Auto-Configuration

If there is a DHCP server on the local area network (LAN), when you start your router for the first time, it comes up in DHCP client mode on its first LAN interface. If there is no DHCP server on the LAN, the router assigns itself a fixed IP address (192.168.1.1) for the interface and switches to DHCP server mode.

Configuring DHCP Client

This section outlines the initial steps required to configure DHCP client on your router. After completing these tasks, restart the router for the new configuration to take effect.

1. Add a special IP address to your router's LAN interface that a DHCP server can dynamically configure.

2. Restart the router to activate the configuration changes.

Assigning a Dynamic IP Address to the LAN Interface

1. At the IP Config> prompt enter add address.

2. Accept 0 for the LAN network (net) number, or select any other LAN interface number.

3. Accept 0.0.0.0 for the LAN interface's IP address.

4. Respond Yes to the prompt that asks if you want to allow dynamic address assignment via DHCP.

IP config> add address
Which net is this address for [0]?
New address [0.0.0.0]?
Allow dynamic address assignment via DHCP(Yes or [No]):yes

Displaying the DHCP Client Monitoring Prompt

To access the DHCP client monitoring environment, enter the following command at the IP> prompt:

IP>dhc

DHCP Client>

DHCP Client Commands

This section describes the DHCP client monitoring commands.

Press Space after you type a command to display the available options for each command. Enter help for information about using the command line interface.

[M] means the command is available at the DHCP Client> prompt.

Table 1 DHCP Client Commands

Command

Function

Clear [M] Clears either global counters or the counters on a specified interface.

Exit [M] Returns to the previous prompt level.

Interface [M]] Lists either a summary of information on the router's LAN interfaces configured for dynamic address assignment or detailed information on a specified interface.

Release [M] Releases the IP address lease on the specified interface.

Statistics [M] Lists global statistical information about the DHCP client.

Clear [M]

Clears either global counters or the counters on a specified interface.

Syntax: clear

Example: clear

Clearing global counters.

Example: clear 0

Clearing counters for client configured on 0.

Exit [M]

Returns to the previous prompt level.

Syntax: exit

Example: exit

Interface [M]

Displays information on all interfaces that you configured to learn their address dynamically or, if you specified the interface number, displays detailed information on the specified interface.

Syntax: interface

Example: interface

DHC Client> interface

Network Number (CR for summary)?

NetName IP Address Mask ServerId State

Eth/0 128.185.5.2 255.255.255.0 192.168.111.250 Bound
TKR/0 0.0.0.0 0.0.0.0 255.255.255.255 Selecting

Interfaces that are Bound:

NetName IP Address Bound Lease Renewal Rebind BroadcastAddr
Time Time Time Time

Eth/0 128.185.5.2 15 1000 500 875 255.255.255.255

Lease Time

time (in seconds) that the DHCP server offered to the client for leasing the IP address.

If not offered, the time defaults to 14,400 seconds
(4 hours).

Renewal Time

time the client must renew its lease with the server that originally offered the lease.

If the server does not specify the time, it is set to half of lease time.

Rebind Time

time the client attempts to contact any server, if it cannot renew its lease in renewing state.

If the server does not specify the lease time, rebind time defaults to (0.875 times lease time).

Example: interface 0

NetName    IP Address      Mask         serverId         State

Eth/0 162.6.0.226 255.255.0.0 162.6.0.20 Bound

Destination address: 162.6.0.20
Requested address: 0.0.0.0
Time since bound: 149
Bad packets received: 0
Discover packets sent: 0
Request packets sent: 0
Decline packets sent: 0
Release packets sent: 0

Active Lease:

serverId: 162.6.0.20
Packet Type: DhcpOffer
Broadcast Address: 162.6.255.255
Lease Time: 1802
Renewal Time: 901
Rebind Time: 1576

Offered Lease(s): None
State

Possible states that the client can be in:

Packet Type

How the client's address was learned

BroadcastAddr

Specified by the server. If no address specified, displays zero (0).

Lease Time

The time that the client is allowed to use the address.

Renewal Time

Time interval set by the server or by default from the time the client receives an IP address until the client transitions to the renewal state.

Rebind Time

Time interval set by the server from the time the client receives an IP address until the client transitions to the rebinding state.

Destination address

Address to which the last DHCP packet was sent. May be either a broadcast address or a server ID.

Requested address

Address the client would like to be offered. (The client may remember the previously assigned address.)

Release [M]

Releases the lease.

Syntax: release

Example: release

Statistics [M]

Displays statistics related to the DHCP and IP forwarding process.

Syntax: statistics

Example: statistics

Number of clients:           1
Number of clients bound: 1
Bad packets received: 0
Buffer allocation failures: 0
Memory allocation failures: 0

Input packet overflows: Net Count
Eth/0 0

Configuring DHCP Server

This section outlines the initial steps required to configure DHCP server. After completing these tasks, restart the router for the new configuration to take effect.

1. Display the DHCP server configuration prompt.

2. Enable the DHCP server.

3. Set DNS, if you want your DHCP server to supply the DNS location to DHCP clients.

4. Set domain name, if you want your DHCP server to supply the domain name.

5. Restart the router to activate the configuration changes.

Notes:

Displaying the DHCP Server Configuration Prompt

To access the DHCP server configuration environment, enter the dhs command at the IP Config> prompt:

IP config>dhs

DHCP Server Config>

Displaying the DHCP Server Monitoring Prompt

To access the DHCP server monitoring environment, enter the dhs command at the IP> prompt:

IP>dhs

DHCP Server>

DHCP Server Commands

This section describes the configuration and monitoring commands for a DHCP server.

Press Space twice after you type a command to display the available options for each command. Enter help for information about using the command line interface.

[C] means the command is available at the DHCP Server config> prompt.

[M] means the command is available at the DHCP Server> prompt.

Table 3 DHCP Server Commands

Command

Function

Add [C] [M] Adds a fixed IP address assignment or an interface address range.

Clear-All [C] Modifies information that you originally entered with the add and set commands.

Delete [C] [M] Deletes DHCP configuration information that you entered with the add command.

Disable [C] [M] Disables a DHCP interface.

Enable [C] [M] Enables a DHCP interface.

Exit [C] [M] Returns to the previous prompt.

Free [C] [M] Frees up an individual DHCP IP address assignment or all DHCP IP address assignments. (Should rarely be needed.)

List [C] [M] Lists configuration settings for a selected DHCP interface, a range of fixed or dynamic IP addresses, profile options, or non-assignable IP addresses.

Revert [M]] Restores the configuration that is in permanent memory to the run-time configuration..

Save [M] Saves the current (running) configuration to permanent memory.

Set [C] [M] Sets the configurable DHCP server parameters for the router.

Notes:

Add [C] [M]

Adds a fixed IP address or a non-assignable IP address range on an interface.

Syntax: add

fixed-assignment
non-assignable-range

fixed-assignment interface-number

Adds a fixed IP address that the DHCP server assigns to a specified client. The specified IP address is permanently reserved for assignment to the machine with the specified MAC address and is not assigned to any other machine.

Example: add fixed-assignment 0

Interface [0]?

IP Address? 128.185.10.16

MAC Address? 000093B40014

Note: If you have already configured a fixed IP address, the address you entered overwrites the MAC address.

non-assignable-range interface number

Defines a range of IP addresses that the DHCP server never assigns to any clients.

Example: add non-assignable-range 0

First address of range [0.0.0.0] ?128.185.4.10
Last address of range [0.0.0.0] ?128.185.4.15

Note: IP address range must be a valid range in the same class network.

Clear-All [C]

Clears all configuration settings for the DHCP server.

Syntax: clear-all

Example: clear-all

Are you sure you want to delete all DHCP Server configuration (Yes or [No])?

Delete [C] [M]

Deletes fixed IP address assignments and non-assignable IP address ranges.

Syntax: delete

fixed-assignment
non-assignable-range

fixed-assignment interface-number

Example: delete fixed-assignment

Interface [0]?

IP Address? 128.185.10.16

non-assignable-range interface-number

Example: delete non-assignable-range

Interface [0]?

First address of range [0.0.0.0] ?128.185.5.10

Last address of range [0.0.0.0] ?128.185.5.15

Disable [C] [M]

Disables the DHCP server on the specified interface. (Turns the server off.)

Syntax: disable interface number

Example: disable

Interface [0]?

Free your run-time in-memory config(Yes or [No]): yes

Notes:

Enable [C] [M]

Enables the DHCP server on the specified interface. (Turns the server on.)

This command by itself is sufficient to get the DHCP server going. The server derives default settings from the IP address configuration on the interface. However, the specified interface must have a fixed IP address configured.

Syntax: enable interface number

Example: enable 0

Exit [C] [M]

Returns to the previous prompt.

Example: exit

IP Config>

or

IP>

Free [C] [M]

Frees up the lease(es) that the DHCP server has dynamically assigned.

Syntax: free

all-dynamic-assignments
one-dynamic assignment

all-dynamic-assignments interface number

Frees up all the leases dynamically assigned to the interface.

Example: free all-dynamic-assignments 0

one-dynamic-assignment interface number

Frees up the lease dynamically assigned to a particular IP address.

Example: free one-dynamic-assignment 0

IP address?128.185.11.17

List [C] [M]

Lists either all or pieces of the DHCP server configuration settings.

Syntax: list

all
dynamic-assignment
fixed-assignment
interfaces
non-assignable-range
profile-options
exit

all interface number

Lists the DHCP server's entire configuration for a specified interface.

Example: DHCP Server config>list all

Interface [5]?

Ifc State Assignable-IP-Address-Range
5 enabled *0.0.0.0-0.0.0.0 (*=automatically derived)

Option Profile: (*=automatically derived)
Subnet Mask: *255.255.0.0
Default Gateway: *162.6.0.34
DNS1: 162.6.0.2
DNS2: 0.0.0.0
DNS3: 0.0.0.0
Domain Name: openroute
Lease Time: 360 seconds

Dynamic assignments:
IP Address MAC Address State BoundTime LeaseTime
162.6.0.1 000093B40014 Bound 0 360

Example: DHCP Server>list all

Ifc State     ClientsBound   ServerId      Assignable-IP-Address-Range
0 enabled 2 *162.6.0.2 *162.6.0.1-162.2.255.254

Option Profile (*=automatically derived):
Subnet Mask: *255.255.255.0
Default Gateway: *10.10.1.237
DNS1: 0.0.0.0
DNS2: 0.0.0.0
DNS3: 0.0.0.0
Domain Name: <none>
Lease Time: 14400 seconds

Non-assignable IP address ranges:
0.0.0.0-0.0.0.0

Dynamic assignments:
IP Address MAC Address State BoundTime LeaseTime
10.10.1.1 000093B4003C Bound 4137 14400
10.10.1.2 000093B8A878 Bound 2877 14400

State

Possible states the server lease can be in:

dynamic-assignment interface number

Lists any IP address(es) dynamically assigned to the selected interface.

Example: list dynamic-assignment

Interface [5]?

Dynamic assignments:
IP Address MAC Address State BoundTime LeaseTime
162.6.0.1 000093B40014 Bound 0 360

fixed-assignment interface number

Lists any fixed IP addresses assigned to the selected interface.

Example: list fixed-assignment

Interface [0]?

Fixed assignments:
IP Address MAC Address State BoundTime LeaseTime
128.185.10.5 000093B40014 Bound 187 300

interfaces

Lists the DHCP server configuration for the router's interfaces.

Example:

DHCP Server Config>list interfaces
Ifc State Assignable-IP-Address-Range (*=automatically derived)
0 disabled *0.0.0.0-0.0.0.0
5 enabled *0.0.0.0-0.0.0.0

Example:

DHCP Server>list interfaces
Ifc State ClientsBound ServerId Assignable-IP-Address-Range
0 enabled-but interface has no fixed IP address-no run-time config
5 enabled 0 *162.6.0.34 *162.6.0.1 - 162.6.255.254

non-assignable-range interface number

Lists any range of IP addresses that the DHCP server cannot dynamically assign.

Example: list non-assignable-range

Interface [5]?

Non-assignable IP address ranges:

128.185.10.10 128.185.10.15

profile-options

Example: list profile options

Interface [5]?

Option Profile (*=automatically derived):
Subnet Mask: *255.255.0.0
Default Gateway: *162.6.0.34
DNS1: 162.6.0.2
DNS2: 0.0.0.0
DNS3: 0.0.0.0
Domain Name: openroute
Lease Time: 360 seconds

Revert [M]

Restores the router's configuration that is in permanent memory.

Syntax: revert interface number

Example: revert

Interface [5]? 

Save [M]

Saves the running configuration to permanent memory.

Syntax: save

Example: save

Interface [5]? 

Set [C] [M]

Sets certain parameters within your DHCP server configuration.

Syntax: set

assignable-range ([C] only)
default-gateway
dns
domain-name
lease-time
subnet-mask

assignable-range interface number

Sets the range of IP addresses that the DHCP server can assign automatically. (This option is not available in monitor mode [M].)

Note: In most situations, you do not need to explicitly configure this option since the automatic default value is a good one. The DHCP server automatically sets the assignable-range to the full range of IP addresses of the subnet mask specified on the router's interface on which the server is running. Example: set assignable-range

First address of range [0.0.0.0]? 128.185.19.1

Last address of range [0.0.0.0]? 128.185.19.5

default-gateway interface number

Sets the default gateway mask that the DHCP server assigns automatically.

Note: In most situations, you do not need to explicitly configure this option since the automatic default value is a good one. The DHCP server automatically sets the default gateway value to be the same as the IP address on the router's interface on which the server is running. Example: set default-gateway 0

Default Gateway (0.0.0.0 = automatic default) [0.0.0.0]?

dns interface number

Sets the Domain Name System (DNS) IP Addresses option that the DHCP server assigns. There is no default value.

Example: set dns 0

DNS1 (0.0.0.0 = none) [0.0.0.0]? 128.185.7.8

domain-name interface number

Sets the domain name option that the DHCP server assigns. There is no default value.

Example: set domain-name 0

Domain name? boston

lease-time interface number

Sets the lease time that the DHCP server assigns to a client.

Example: set lease-time 0

lease time [14400]? 3600

subnet-mask interface number

Sets the subnet mask that the DHCP server assigns automatically.

Note: In most situations, you do not need to explicitly configure this option since the automatic default value is a good one. The DHCP server automatically defaults the subnet mask value to be the same as the IP subnet mask on the router's LAN interface on which the server is running. Example: set subnet-mask 0

Subnet Mask (0.0.0.0 = automatic default) [0.0.0.0]? 



docs@openroute.com
Copyright © 1998, OpenROUTE Networks, Inc. All rights reserved.