Go to Wi-Fi Settings in Wi-Fi options

Choose Wi-Fi

in your WI-FI connection go to details

In the search domain, enter: 8.8.8.8 and 8.8.4.4 in DNS.

When configuring IPv4 you must choose “manually”
In IP address you must choose the one you want, in my case 192.168.0.200
The private IP address must be between 192.168.0.0 and 192.168.0.255

You can verify that the private IP address is the one you chose:
ipconfig getifaddr en0

en0 is my primary network interface
You can also see it in the router interface:

It is very important that you know that it only works for the WI-FI where you configure it, if you connect to another WI-FI network you will not have internet
To have Wi-Fi internet on another network you must make the same changes as before, obtain IP by DHCP