Getting a Fixed / Static IP Address for ESP8266

If you want the ESP8266 (or any other network connected device) to always have the same IP address then the best way is leave the device configured to get an IP address using DHCP and assign the desired IP address in the router. Most routers allow you to associate a specific IP address with a particular MAC address.

This has the advantage that the router is in control of IP address allocation, and and if you want multiple devices all with different IP addresses you can set them all in one place, in the router, rather than having to hard code different IP addresses in each device.

1 Like