← index #17977PR #8882
Related · high · value 1.772
QUERY · ISSUE

Cannot change default exposed IP (for DHCP etc) on Pico W running in AP mode (remains exposing default 192.168.4.x)

openby magnus-0opened 2025-08-22updated 2025-09-23
bugport-rp2

Port, board and/or hardware

Pico W

MicroPython version

MicroPython v1.26.0 on 2025-08-09; Raspberry Pi Pico W with RP2040

Reproduction

  1. Create a WLAN in IF_AP mode and set IP (and subnet, GW, DNS, etc) via WLAN.ifconfig
  2. Confirm that ifconfig() returns the expected parameters
  3. Conclude that the exposed IP address (incl DHCP range etc) when connecting clients to the AP remains the default 192.168.4.1

Expected behaviour

Expected the exposed DHCP gateway address and range to follow the set parameters, instead of the default 192.168.4.1

Observed behaviour

DHCP gateway address and range remain 192.168.4.1

Additional Information

(!) Do ensure ifconfig() is called áfter activating the WLAN, as otherwise it will definitely reset to the default settings, confirmed by printing them. So WLAN.active(true), then WLAN.ifconfig(...)

See also this link
and this link

Code of Conduct

Yes, I agree

CANDIDATE · PULL REQUEST

netutils/dhcpserver.c: Match default DNS to AP IP.

closedby Gadgetoidopened 2022-07-07updated 2022-07-12

Change the default DNS to match the gateway IP of a board running in access point mode.

This fixes the rather meaningless use of "8.8.8.8" as the default DNS server address offered up to access point clients via the DHCP server. Since most (all?) devices wont be able to proxy access to the real "8.8.8.8".

It allows for a DNS responder to run on - for example - the Pico W and provide a catchall response for captive portal functionality, or just a quality-of-life response to a friendly URL for access-point based configuration and other applications.

This does not (as far as I'm aware!) change the default DNS server used in client mode, since it's explicitly set from the ifconfig with dns_setserver.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied