OcNOS-RON : System Management Guide : System Management Configuration Guide : DHCP Server Configuration
DHCP Server Configuration
Overview
A DHCP Server is a network server that automatically provides and assigns IP addresses, default gateways and other network parameters to client devices. It relies on the standard protocol known as Dynamic Host Configuration Protocol or DHCP to respond to broadcast queries by clients.
DHCP Server Configuration for IPv4
Before configuring make sure that DHCP server is ready.
Topology
 
DHCP IPv4 topology
Configuration
DHCP IPv4 Client Interface
 
#configure terminal
Enter Configure mode.
(config)#interface xe1
Specify the interface (xe1) to be configured and enter the interface mode.
(config-if)#ip address dhcp
The client requests for the IP address to the server, once it receives the acknowledgment from the server, it assigns the IP address to the interface in which this command is enabled.
(config-if)#ip dhcp client request dns-nameserver
The client requests for the DNS name server.
(config-if)#ip dhcp client request ntp-server
The client requests for the NTP server .
(config-if)#ip dhcp client request host-name
The client requests for the Name of the client.
(config-if)#ip dhcp client request log-server
The client requests for the log server.
(config if)#exit
Exit interface mode.
DHCP IPv4 Server Interface
 
#configure terminal
Enter Configure mode.
(config)#interface xe2
Specify the interface (xe2) to be configured and enter the interface mode.
(config-if)#ip address 10.10.10.1/24
Configure the IP address to the server interface.
(config-if)#ip address dhcp
The client requests for the IP address to the server, once it receives the acknowledgment from the server, it assigns the IP address to the interface in which this command is enabled.
(config if)#exit
Exit interface mode.
(config)#commit
Commit the candidate configuration to the running configuration.
DHCP IPv4 Server Feature
 
#configure terminal
Enter Configure mode.
(config)#ip vrf vrf1
Configure IP VRF name.
(config-vrf)#ip dhcp server max-lease-time 100
Configure max lease time.
(config-vrf)#ip dhcp server default-lease-time 100
Configure default lease time.
(config-vrf)#ip dhcp server pool test
Configure DHCP server pool name.
(dhcp-config)#network 3.3.3.0 netmask 255.255.255.0
Configure network and netmask.
(dhcp-config)#address range low-address 3.3.3.1 high-address 3.3.3.4
Configure address IPv4 range.
(dhcp-config)#boot-file test
Configure boot-file name.
(dhcp-config)#host-name dhcp-server
Configure host name.
(dhcp-config)#ntp-server 4.4.4.5
Configure NTP server.
(dhcp-config)#log-server 5.5.5.6
Configure log server.
(dhcp-config)#dns-server 5.5.5.5
Configure DNS server.
(dhcp-config)#tftp-server 5.5.5.6
Configure TFTP server.
(dhcp-config)#boot-file test
Configure boot-file name.
Validation
Client
OcNOS#show running-config dhcp
interface eth0
ip address dhcp
!
interface xe47
ip address dhcp
ip dhcp client request dns-nameserver
ip dhcp client request host-name
ip dhcp client request log-server
ip dhcp client request ntp-server
!
!
 
OcNOS#show ip int br
 
'*' - address is assigned by dhcp client
 
Interface IP-Address Admin-Status Link-Status
ce54 unassigned up down
eth0 *10.12.122.114 up up
lo 127.0.0.1 up up
lo.management 127.0.0.1 up up
xe47 *10.10.10.2 up up
xe48 unassigned up down
 
OcNOS#conf t
Enter configuration commands, one per line. End with CNTL/Z.
OcNOS(config)#int xe6
OcNOS(config-if)#ip dhcp client request host-name
OcNOS(config-if)#commit
OcNOS(config-if)#
OcNOS(config-if)#
OcNOS(config-if)#end
dhcp-client#
dhcp-client#
dhcp-client#
dhcp-client#sh hostname
*dhcp-client
 
* - Hostname learnt by DHCP Client.
dhcp-client#
Server
OcNOS#show run dhcp
interface eth0
ip address dhcp
!
!
 
ip dhcp server max-lease-time 100
ip dhcp server default-lease-time 100
ip dhcp server pool test
network 10.10.10.0 netmask 255.255.255.0
address range low-address 10.10.10.1 high-address 10.10.10.5
host-name dhcp-client
boot-file test
tftp-server 5.5.5.6
ntp-server 4.4.4.5
log-server 5.5.5.6
dns-server 5.5.5.5
interface ge5
ip dhcp server
DHCP Server Configuration for IPv6
Before configuring make sure that DHCP server is ready.
Topology
 
DHCP IPv6 topology
Configuration
DHCP IPv6 Client Interface
 
#configure terminal
Enter Configure mode.
(config)#interface xe47
Specify the interface (xe47) to be configured and enter the interface mode.
(config-if)#ipv6 address dhcp
The client requests for the IPv6 address to the server, once it receives the acknowledgment from the server, it assigns the IP address to the interface in which this command is enabled.
(config-if)#ipv6 dhcp client request dns-nameserver
The client requests for the DNS name server.
(config-if)#ipv6 dhcp client request ntp-server
The client requests for the NTP server.
(config-if)#ipv6 dhcp client request domain-search
The client request for IPv6 domain search.
(config-if)#ipv6 dhcp client request vendor-specific-information
The client request for IPv6 vendor-specific-information.
(config-if)#ipv6 dhcp client request rapid-commit
The client request to enable rapid-commit.
(config if)#exit
Exit interface mode.
(config)#commit
Commit the candidate configuration to the running configuration.
DHCP IPv6 Server Interface
 
#configure terminal
Enter Configure mode.
(config)#interface xe2
Specify the interface (xe2) to be configured and enter the interface mode.
(config-if)#ipv6 address dhcp
The client requests for the IPv6 address to the server, once it receives the acknowledgment from the server, it assigns the IP address to the interface in which this command is enabled.
(config-if)#ipv6 address 2001::1/64
Configure the IPv6 address to the server interface.
(config if)#ipv6 dhcp server
Configure an interface as a DHCP server starting interface.
(config if)#exit
Exit interface mode.
(config)#commit
Commit the candidate configuration to the running configuration.
DHCP IPv6 Server Feature
 
#configure terminal
Enter Configure mode
(config)#ip vrf vrf1
Configure IP VRF name
(config-vrf)#ipv6 dhcp server preference
Configure IPv6 DHCP server preference
(config-vrf)#ipv6 dhcp server rapid-commit
Configure IPv6 DHCP server rapid-commit
(config-vrf)#ipv6 dhcp server pool test
Configure IPv6 DHCP server pool name
(dhcp6-config)#network 2001:: netmask 64
Configure IPv6 network and netmask
(dhcp6-config)#address range low-address 2001::1 high-address 2001::124
Configure IPv6 address range
(dhcp6-config)#vendor-options 00:00:09:bf:63
Configure IPv6 vendor option
(dhcp6-config)#ntp-server 4001::1
Configure IPv6 NTP server
(dhcp6-config)#dns-server 3001::1
Configure IPv6 DNS server
(dhcp-config)#log-server 5.5.5.6
Configure log server
(dhcp6-config)#domain-name abcd
Configure domain name
(dhcp-config)#tftp-server 5.5.5.6
Configure TFTP server
(dhcp-config)#boot-file test
Configure boot-file name
Validation
Client
OcNOS#sh running-config dhcp
interface eth0
ip address dhcp
!
interface xe2
ipv6 dhcp client request dns-nameserver
ipv6 dhcp client request domain-search
ipv6 dhcp client request ntp-server
ipv6 dhcp client request rapid-commit
ipv6 dhcp client request vendor-specific-information
ipv6 address dhcp
!
 
OcNOS#show ipv6 int br
Interface IPv6-Address Admin-Sta
tus
ce49 unassigned [up/down]
 
eth0 fe80::e69d:73ff:fe05:8100 [up/up]
 
lo ::1 [up/up]
 
lo.management ::1 [up/up]
 
xe45 unassigned [up/down]
 
xe46 unassigned [up/down]
 
xe47 *2001::124
fe80::e69d:73ff:fe84:8137 [up/up]
 
xe48 unassigned [up/down]
 
Server
OcNOS#show running-config dhcp
interface eth0
ip address dhcp
!
!
 
ipv6 dhcp server rapid-commit
ipv6 dhcp server preference
ipv6 dhcp server pool test
network 2001:: netmask 64
address range low-address 2001::1 high-address 2001::124
vendor-options 00:00:09:bf:63
ntp-server 4001::1
dns-server 3001::1
domain-name abcd
interface xe2
ipv6 dhcp server
!