Description:

This article describes how any network member is assigned a specific IP address on a specific port of a GS-23xx switch by operating the latter as a DHCP relay agent and a LANCOM router as a DHCP relay server. The port information is transmitted from the switch to the LANCOM router by circuit ID.


Reqirements:


Scenario:


Procedure:

1) Configuring the GS-23xx switch:

1.1) Connect to the web GUI of the switch and navigate to the menu Security → DHCP Relay → Configuration and modify the following parameters:

1.2) Click Add, modify the following parameters and then click Apply:

1.3 Navigate to the menu Maintenance → Save/Restore → Save Start and click on Save so that the configuration is saved as a Start configuration.

The start configuration is retained even if the device is restarted or there is a power failure.



2) Configuring the LANCOM router:

2.1) Use LANconfig to connect to the router and navigate to the menu IPv4 → DHCPv4 → DHCP networks.

2.2) Create a new DHCP network and modify the following parameters:

When setting up a DHCP relay server, it is essential that you specify the IP address pool (first address and last address) and also the netmask.

2.3) Confirm the dialog with Yes. This is necessary because the network is not created in the router in the menu IP networks.

If the router is already being used as a DHCP server for local networks, the DHCP address assignment for these networks no longer works if the DHCP requests are sent to the router via the switch. This is due to the included DHCP relay information, which the regular DHCP server cannot process.

In this case, a DHCP network must be created with the relay agent IP address for the local network (in this example 192.168.1.*). The entry for the local network (in this case INTRANET) must be disabled by setting the parameter DHCP server enabled to No. Note that following this, DHCP requests should only be sent to the router via the switch.

2.4) Go to the menu IPv4 → BootP → Relay info.

2.5) Create a new entry and adjust the following parameters:

The circuit ID consists of five fields, where the fifth field (Relay Custom Info) is optional and not used in this scenario. 

Note that the circuit ID in the switch is encoded in binary, but is expected by the router in hexadecimal notation. This can be seen in an Ethernet trace (filtered for BootP). For this reason the circuit ID must be prefixed with the string 0x. Furthermore, the VID and the port number must be converted if necessary. 

  1. Circuit ID type: The 1 stands for circuit ID. The field has two digits, so the entry has to be 01.
  2. Length: Unless relay custom info is transmitted, the length is always 4 bytes (i.e. 2 bytes each for the VLAN ID and the port). The field has two digits, so the entry has to be 04.
  3. VID: Enter the VLAN ID of the switch port. The field has four digits, so the entry could be 0010 for example.
  4. Port number: Enter the port number of the switch port. The field has four digits, so the entry could be 0009 for example.
  5. Relay custom info: Additional information can optionally be entered into this field. 

Example:

A network member in VLAN 10 and connected to port 9 should be given a specific IP address. The VID 10 is a in hexadecimal notation. The resulting circuit ID appears as follows:

Hexadecimal notationCircuit ID typeLengthVIDport number
0x0104000a0009

2.6) This concludes the configuration steps on the router. Write the configuration back to the router.