DHCP Relay Agent Configuration for IPv4
This section shows how to configure the DHCPv4 relay agent.
DHCPv4 Relay Agent
OcNOS#configure terminal |
Enter configure mode. |
OcNOS(config)#ip dhcp relay server-group dhcp-relay-gp |
Configure relay server-group group name in global mode. |
OcNOS(dhcp-relay-group)#server 10.10.10.2 |
Configure server |
OcNOS(dhcp-relay-group)#exit |
Exit DHCP relay group. |
OcNOS(config)#interface xe15 |
Enter interface mode |
OcNOS(config-if)#ip address 20.20.20.2/24 |
Configure IPv4 address |
OcNOS(config-if)#ip dhcp relay |
Relay should be configured on the interface connecting to the client. |
OcNOS(config-if)#commit |
Commit the candidate configuration to the running configuration. |
OcNOS(config-if)#exit |
Exit interface mode. |
OcNOS(config)#interface xe8 |
Enter interface mode |
OcNOS(config-if)#ip address 10.10.10.3/24 |
Configure IPv4 address |
OcNOS(config-if)#ip dhcp relay uplink |
Configure relay uplink on the device connecting the server. |
OcNOS(config-if)#ip dhcp relay server-select dhcp-relay-gp |
Configure relay server-select group name on the device connected to the server. |
OcNOS(config-if)#commit |
Commit the candidate configuration to the running configuration. |
OcNOS(config-if)#exit |
Exit interface mode. |
OcNOS(config)#ip dhcp relay server-group dhcp-relay-gp |
Configure relay server-group group name in global mode. |
OcNOS(dhcp-relay-group)#server 40.10.10.2 |
Configure IPv4 DHCP server address |
OcNOS(dhcp-relay-group)#commit |
Commit the candidate configuration to the running configuration. |
OcNOS(dhcp-relay-group)#exit |
Exit DHCP relay group. |
OcNOS(config)#interface xe11 |
Enter interface mode |
OcNOS(config-if)#ip address 40.10.10.3/24 |
Configure IPv4 address |
OcNOS(config-if)#ip dhcp relay uplink |
Configure relay uplink on the device connecting the server. |
OcNOS(config-if)#ip dhcp relay server-select dhcp-relay-gp |
Configure relay server-select group name on the device connected to the server. |
OcNOS(config-if)#commit |
Commit the candidate configuration to the running configuration. |
OcNOS(config-if)#exit |
Exit interface mode. |
Validation
The below shows the running configuration of the DHCPv4 relay agent node:
OcNOS#show running-config dhcp
interface eth0
ip address dhcp
!
!
ip dhcp relay server-group dhcp-relay-gp
server 10.10.10.2
server 40.10.10.2
interface xe8
ip dhcp relay uplink
ip dhcp relay server-select dhcp-relay-gp
!
interface xe11
ip dhcp relay uplink
ip dhcp relay server-select dhcp-relay-gp
!
interface xe15
ip dhcp relay
!
OcNOS#
OcNOS#
OcNOS#show ip dhcp relay
DHCP relay service is Enabled.
VRF Name: default
Option 82: Disabled
Interface Uplink/Downlink
--------- -------------
xe8 Uplink
xe11 Uplink
xe15 Downlink
Interface Group-Name Server
--------- ------------- ------
xe11 dhcp-relay-gp 10.10.10.2,40.10.10.2
Incoming DHCPv4 packets which already contain relay agent option are FORWARDED u
nchanged.
OcNOS#