DHCPs + eth: keep assign new IP to same board

newsettler_AI
Posts: 121
Joined: Wed Apr 05, 2017 12:49 pm

DHCPs + eth: keep assign new IP to same board

Postby newsettler_AI » Thu Jul 14, 2022 4:36 pm

I've configured one ESP32 as DHCP server and connected via Ethernet it with another ESP32 board.
Problem is when I'm reconnecting eth cable, DHCP server always assign new IP address to the same board:

Code: Select all

(19977) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.1.4
(29980) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.1.5
(47978) esp_netif_lwip: DHCP server assigned IP to a station, IP is: 192.168.1.6
Should I somehow release it manually after link lost?

My dhcps config:

Code: Select all

	const esp_netif_inherent_config_t eth_behav_cfg = {
			.get_ip_event = IP_EVENT_ETH_GOT_IP,
			.lost_ip_event = 0,
			.flags = ESP_NETIF_DHCP_SERVER | ESP_NETIF_FLAG_AUTOUP,
			.ip_info = (esp_netif_ip_info_t*)& ext_ip_info,
			.if_key = "ETH_DHCPS",
			.if_desc = "eth",
			.route_prio = 50
	};

	esp_netif_config_t eth_as_dhcps_cfg = {
			.base = &eth_behav_cfg,
			.stack = ESP_NETIF_NETSTACK_DEFAULT_ETH
	};
	esp_netif_t *eth_netif = esp_netif_new(&eth_as_dhcps_cfg);
Or this is normal behavior of DHCP server?.. :?

newsettler_AI
Posts: 121
Joined: Wed Apr 05, 2017 12:49 pm

Re: DHCPs + eth: keep assign new IP to same board

Postby newsettler_AI » Thu Jul 21, 2022 2:11 pm

Any advices? :roll:

Who is online

Users browsing this forum: Bing [Bot] and 212 guests