OcNOS-SP : System Management Guide : System Management Configuration Guide : DHCP Server Configuration : DHCP Server Configuration for IPv4
DHCP Server Configuration for IPv4
Before configuring make sure that DHCP server is ready.
Topology
 
Figure 12-19: 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
Last modified date: 10/19/2023