[Enhancement]ECS2100 series support both Layer 2 and Layer 3 DHCP Relay

Steven_zhangCreated at:Dec 11, 2019 14:28:27Updated at:Dec 11, 2019 14:28:33

ECS2100 series firmware version v1.2.2.12 and above has a new software enhancement which support Layer 2 / Layer 3 DHCP Relay function. And the user may choose to use the L2 or L3 DHCP Relay by following commands (Default is L3). 

The setting for Layer 2 DHCP Relay

Console(config)#ip dhcp l2 relay

The setting for Layer 3 DHCP Relay

Console(config)#ip dhcp l3 relay

When the client and DHCP server are in the same VLAN and subnet, the client may obtain the IP address from DHCP server directly. However, in practical network, clients might be in the different subnet and VLAN, then DHCP Relay function can help to get the IP address from DHCP server which is in the different subnet.

 

- L2 DHCP Relay

The L2 DHCP Relay function can be used to add the suboption information (DHCP Option 82.) and the DHCP server may refer it to assigns the corresponding IP address.

 

Topology:

_____2018-10-15___10.25.01.png

 

Configuration on ECS2100-28T:

1) Configure the port 2 to VLAN 2.

Console(config)#interface ethernet 1/2
Console(config-if)#switchport native vlan 2
Console(config-if)#switchport mode access

2) Set IP address on VLAN interface.

Console(config)#int vlan 1
Console(config-if)#ip address 192.168.1.1/24
Console(config-if)#exit

3) Enable the L2 DHCP relay and configure the IP address of DHCP server.

Console(config)#ip dhcp l2 relay
Console(config)#ip dhcp relay information option
Console(config)#ip dhcp relay server 192.168.1.254


L2 DHCP Relay packet forwarding procedures:

_____2018-10-15___10.19.41.png

 

In this example, the client will get the IP address in the range of 192.168.2.240~192.168.250 from the DHCP server. 

==================================================================

 

- L3 DHCP Relay

The L3 DHCP Relay function will convent the DHCP broadcast packet into the unicast packet and add the DHCP Relay agent IP address. Then DHCP server can refer to the Relay agent IP address to assigns the corresponding IP address.

 

Topology:

_____2018-10-10___2.49.56.png

Configuration on ECS2100-28T:

1) Configure the port 2 to VLAN 2 and port 3 to VLAN 3.

Console(config)#interface ethernet 1/2
Console(config-if)#switchport native vlan 2
Console(config-if)#switchport mode access
Console(config-if)#exit
Console(config)#interface ethernet 1/3
Console(config-if)#switchport native vlan 3
Console(config-if)#switchport mode access
Console(config-if)#exit

2) Set IP address on VLAN interface.

Console(config)#int vlan 1
Console(config-if)#ip address 192.168.1.1/24
Console(config-if)#exit
Console(config)#int vlan 2
Console(config-if)#ip address 192.168.2.1/24
Console(config-if)#exit
Console(config)#int vlan 3
Console(config-if)#ip address 192.168.3.1/24
Console(config-if)#exit

3) Enable the L3 DHCP relay and configure DHCP relay server on VLAN interface.

Console(config)#ip dhcp l3 relay
Console(config)#int vlan 2
Console(config-if)#ip dhcp relay server 192.168.1.254
Console(config-if)#exit
Console(config)#int vlan 3
Console(config-if)#ip dhcp relay server 192.168.1.254
Console(config-if)#exit

 

L3 DHCP Relay packet forwarding procedures:

Example of client B.

_____2018-10-15___10.13.18.png

In this example, 
Client A can get the IP address in the range of 192.168.2.240-250 the DHCP server.
Client B can get the IP address in the range of 192.168.3.240-250 the DHCP server.