I'm trying to set a static IP address for a rpi 4, and use a tablet as screen which will connect it through remote Desktop application.

I tried to modify the /etc/dhcpcd.conf and add those lines:

 Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.

# Use the hardware address of the interface for the Client ID.
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.

# Persist interface configuration when dhcpcd exits.

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu

# Most distributions have NTP support.
#option ntp_servers

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate SLAAC address using the Hardware Address of the interface
#slaac hwaddr
# OR generate Stable Private IPv6 Addresses based from the DUID
slaac private

# Example static IP configuration:
#interface wlan0
#static ip_address=
#static routers=
#static domain_name_servers= fd51:42f8:caae:d92e::1

# It is possible to fall back to a static IP if DHCP fails:
# define static profile
#profile static_eth0
#static ip_address=
#static routers=
#static domain_name_servers=

# fallback to static profile on eth0
#interface eth0
#fallback static_eth0

interface wlan0
static ip_address=
static routers=
static domain_name_servers=


PING ( 56(84) bytes of data.
From icmp_seq=1 Destination Host Unreachable
From icmp_seq=2 Destination Host Unreachable
From icmp_seq=3 Destination Host Unreachable

ping google.com:

PING google.com(par10s38-in-x0e.1e100.net (2a00:1450:4007:805::200e)) 56 data bytes
64 bytes from par10s38-in-x0e.1e100.net (2a00:1450:4007:805::200e): icmp_seq=1 ttl=118 time=14.3 ms
64 bytes from par10s38-in-x0e.1e100.net (2a00:1450:4007:805::200e): icmp_seq=2 ttl=118 time=13.6 ms
64 bytes from par10s38-in-x0e.1e100.net (2a00:1450:4007:805::200e): icmp_seq=3 ttl=118 time=14.3 ms
64 bytes from par10s38-in-x0e.1e100.net (2a00:1450:4007:805::200e): icmp_seq=4 ttl=118 time=13.5 ms
64 bytes from par10s38-in-x0e.1e100.net (2a00:1450:4007:805::200e): icmp_seq=5 ttl=118 time=14.4 ms

ip a && ip r

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether dc:a6:32:94:13:f5 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether dc:a6:32:94:13:f6 brd ff:ff:ff:ff:ff:ff
    inet brd scope global noprefixroute wlan0
       valid_lft forever preferred_lft forever
    inet6 2001:861:3884:2ff0:93ae:6353:1925:63fb/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 86245sec preferred_lft 14245sec
    inet6 fe80::123d:2751:278:4453/64 scope link 
       valid_lft forever preferred_lft forever
default via dev wlan0 src metric 303 dev wlan0 proto dhcp scope link src metric 303 

ip link

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether dc:a6:32:94:13:f5 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT group default qlen 1000
    link/ether dc:a6:32:94:13:f6 brd ff:ff:ff:ff:ff:ff

Until now, everything is ok, the tablet accesses the rpi4 and I can use it. After the modification, rpi lost the connection to the net and I get unreachable page for every search I do on the net. I found a similar issue on the rpi forum Loose access to internet when I setup static IP but it does not fix the issue. There is a detailed answer How do I set up networking/WiFi/static IP address on Raspbian/Raspberry Pi OS? I followed the steps but I didn't find my mistake or what I did wrong in my config. Any thoughts on how I can fix that?

  • What happens if you ping google.com and ping - please edit you post with results of both commands. Can you also add the output of ip link – user115418 Dec 16 '20 at 1:14
  • 1
    Post the output of ip a && ip r into your Question – Milliways Dec 16 '20 at 2:24
  • @Milliways I edited the question. – P.A Dec 16 '20 at 16:00
  • Most questions on this site are about static ip addresses. No, it does not make things simple. On the contrary, it makes things more complicated if you do not understand detailed networking. Please have a look at all the other answers about static ip address. Are you sure that isn't used by another device? – Ingo Dec 16 '20 at 17:34
  • even with another ip address does not work too – P.A Dec 16 '20 at 18:38

I will make a guess that you have screwed something up when you modified /etc/dhcpcd.conf. Nothing against you - it happens frequently. As I write this, there are 683 questions about dhcpcd here on RPi SE. I would like for you to do two things:

1. Remove all of your edits to /etc/dhcpcd & re-start your RPi, or:

$ sudo service dhcpcd restart

If your RPi now networks properly, read on. If not, you can stop here & move on to another answer.

2. Read man dhcpcd.conf

Don't be tempted to use the static_ipaddress option in /etc/dhcpcd.conf. Do not attempt to configure a static IP in /etc/dhcpcd.conf. man dhcpcd.conf is specific about this:

For IPv4, you should use the inform ipaddress option instead of setting a static address.

3. Still want a static address?

By ignoring the advice in man dhcpcd.conf, you're putting yourself in an awkward position - you're implying that you know more about DHCP and networking than the author of dhcpcd. If you still want/need a static IP add the inform ipaddress to /etc/dhcpcd.conf as follows:


This is all that's needed - one line. dhcpcd will take it from there, and continue to communicate with your DHCP server and support your choice of an IP address. DHCP is happy and well-informed, and you'll have fewer issues.

Reboot (or sudo service dhcpcd restart) after adding this line to /etc/dhcpcd.conf. If your wlan0 interface is not getting that address, check /var/log/syslog for any noise regarding allocation of this address, and check your DHCP server's listing of active leases to make sure another host isn't using


  • dhcpcd logs to /var/log/syslog on RPi by default. Take a look at it.
  • While I have some sympathy with the sentiments expressed - there is NOTHING WRONG with static ip_address = if you do not have a DHCP server and if you do request is preferable to inform. – Milliways Dec 16 '20 at 11:22
  • @Milliways: Just quoting from "the book". I think dhcpcd is a brilliant effort, and Roy Marples is knowledgeable. As I said, taking issue with the author's recommendations might be awkward - I'll leave that turf to you. – Seamus Dec 17 '20 at 1:54
  • 1
    The man also says "inform … If dhcpcd fails to contact a DHCP server then it returns a failure" – Milliways Dec 17 '20 at 3:24
  • @Milliways: That's a valid point, but the failure (an error I assume) would be an indication that something is amiss. In either case, reviewing the log file would provide some insight. I won't argue the point - but again, I'm passing along a specific point made in the man page. – Seamus Dec 17 '20 at 6:35

Your current settings look OK, but we cannot know if they are correct.

"Until, now everything is ok, … and I can use it" is not English and is unclear, but if you mean it works if you don't set static IP Address the obvious conclusion is you have done something wrong.

I suggest you try WITHOUT static IP Address and see what ip a && ip r show then.

If you followed the process in https://raspberrypi.stackexchange.com/a/74428/8697 to discover correct settings it should work.

If the reason you are using a Static IP Address is you want your Pi to be assigned a predictable IP Address you can request the DHCP server to assign one.

interface wlan0
request 192.168.…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.