diff --git a/subsys/net/ip/net_shell.c b/subsys/net/ip/net_shell.c index bc3a0657112..762c1bfdb6d 100644 --- a/subsys/net/ip/net_shell.c +++ b/subsys/net/ip/net_shell.c @@ -3155,7 +3155,7 @@ static int cmd_net_ping(const struct shell *shell, size_t argc, char *argv[]) if (IS_ENABLED(CONFIG_NET_IPV4)) { ret = ping_ipv4(shell, host, count, interval); if (ret) { - if (ret == -EIO) { + if (ret == -EIO || ret == -ENETUNREACH) { PR_WARNING("Cannot send IPv4 ping\n"); } else if (ret == -EINVAL) { PR_WARNING("Invalid IP address\n");