DHCP Server-1 Configuration for IPv4

This section shows how to configure the DHCPv4 Server-1.

DHCPv4 Server-1

OcNOS#configure terminal

Enter configure mode.

OcNOS(config)ip dhcp server pool DHCP-Server-1

Configure DHCP server group for server in global mode.

OcNOS(dhcp-config)#network 10.10.10.0 netmask 255.255.255.0

Configure network 10.10.10.0 and netmask 255.255.255.0.

OcNOS(dhcp-config)#address range low-address 10.10.10.1 high-address 10.10.10.254

Configure address range from 10.10.10.1 to 10.10.10.254.

OcNOS(dhcp-config)#dns-server 192.2.2.2

Configure the DNS server 192.2.2.2.

OcNOS(dhcp-config)#commit

Commit the candidate configuration to the running configuration.

OcNOS(dhcp-config)#exit

Exit DHCP config mode.

OcNOS(config)#ip dhcp server pool DHCP-SER

Configure DHCP server group for client in global mode.

OcNOS(dhcp-config)#network 20.20.20.0 netmask 255.255.255.0

Configure network 20.20.20.0 and netmask 255.255.255.0.

OcNOS(dhcp-config)#address range low-address 20.20.20.1 high-address 20.20.20.30

Configure address range from 20.20.20.1 to 20.20.20.30.

OcNOS(dhcp-config)#commit

Commit the candidate configuration to the running configuration.

OcNOS(dhcp-config)#exit

Exit dhcp config mode.

OcNOS(config)#interface xe8

Enter interface mode xe8.

OcNOS(config-if)#ip address 10.10.10.2/24

Configure IP address on the interface xe8.

OcNOS(config-if)#ip dhcp server

Server should be configured on the interface while connected to the relay.

OcNOS(config-if)#commit

Commit the candidate configuration to the running configuration.

OcNOS(config-if)#exit

Exit interface mode.

OcNOS(config)#ip route 20.20.20.0/24 10.10.10.3

Configure static route of 20.20.20.0/24 by next hop interface 10.10.10.3.

OcNOS(config)#commit

Commit the candidate configuration to the running configuration.

OcNOS(config)#exit

Exit config mode.

Validation

The below shows the running configuration of the DHCPv4 Server-1 node:

Copy
OcNOS#show running-config dhcp
interface eth0
 ip address dhcp
!
!
 
ip dhcp server pool DHCP-Server-1
 network 10.10.10.0 netmask 255.255.255.0
 address range low-address 10.10.10.1 high-address 10.10.10.254
 dns-server 192.2.2.2
ip dhcp server pool DHCP-SER
 network 20.20.20.0 netmask 255.255.255.0
 address range low-address 20.20.20.1 high-address 20.20.20.30
interface xe8
 ip dhcp server
!
OcNOS#