Description:

This article describes how any network member is assigned a specific IP address on a specific port of a GS-3xxx 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.


Requirements:


Scenario:

  • On the LANCOM router, a DHCP relay server is created for the network 192.168.10.0/24. However, the network itself does not exist on the router.
  • The GS-3xxx switch operates as a DHCP relay agent and forwards DHCP requests to the DHCP relay server on the LANCOM router.
  • For the GS-3xxx switch, any network device connected to port 7 should receive the IP address 192.168.10.75.


Procedure:

1) Configuring the GS-3xxx switch:

1.1) Connect to the switch via the webinterface, go to the menu DHCP → Relay → Configuration, modify the following parameters and click Apply:

  • Relay Mode: Activate the feature via the slider.
  • Relay Server: Enter the IP address of the DHCP relay server (in this example 192.168.1.254).
  • Relay Information Mode: In the dropdown menu select the option Enabled. This is required for transmission of the circuit ID.
  • Relay Information Policy: In the dropdown menu select the option Keep. If the switch receives a DHCP packet, which already contains DHCP relay information, this will be retained.

1.2) Acknowledge the popup note by clicking OK.

The note is intended to remind you, that when using DHCP Snooping the port to the DHCP server has to be set to Trusted. As DHCP Snooping is not used in this scenario. the note can be ignored.

1.3) Click on the red "disk symbol" in the upper right corner to save the configuration as the start configuraton.

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:

  • Network name: Enter the relay agent IP address for the desired network. Here, the final octet must contain a * (in this example 192.168.10.*). 
  • DHCP server enabled: From the drop-down menu, select the option Yes.
  • First address: Enter the first IP address of the IP address pool (in this example 192.168.10.50).
  • Last address: Enter the last IP address of the IP address pool (in this example 192.168.10.100).
  • Netmask: Enter the subnet mask for the related network (in this example 255.255.255.0).
  • Broadcast: Optionally enter the broadcast address of the network (in this example 192.168.10.255).
  • Default gateway: Enter the IP address of the DHCP relay server (in this example 192.168.10.254).

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.

Important note if the DHCP server on the router is operated for additional local 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:

  • Circuit ID: Enter the circuit ID that is transmitted from the switch to the router (in this example 0x000a0007).
  • IP address: Enter the IP address that is to be assigned to the network member at the desired switch port.
  • Station name: Optionally enter a station name.

Aufbau der Circuit-ID:

The circuit ID consists of three fields. Note that the circuit ID in the switch is already encoded in hexadecimal notation. As the router also expects the circuit ID in hexadecimal notation, it doesn't have to be converted. This can be seen in an Ethernet trace (filtered for BootP). In the router the circuit ID must be prefixed with the string 0x.

  1. vlan_id: Stands for the VLAN ID of the switch port. The field has four digits, so the entry could be 000a for example.
  2. module_id: Stands for the Module ID of the switch. For GS-3xxx switches this is always 00.
  3. port_no: Stands for the Port number of the switch port. The field has two digits, so the entry could be 07 for example.

Example:

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

Hexadecimal notationvlan_idmodule_idport_no
0x000a0007

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