From: Matthias May <matthias.may@neratec.com>
To: Vaidas BoQsc <vaidas.boqsc@gmail.com>, netdev@vger.kernel.org
Subject: Re: A robust correct way to display local ip addresses of the device Gautieji x
Date: Tue, 31 Mar 2020 15:08:36 +0200 [thread overview]
Message-ID: <9910386d-deec-720a-fb2c-7c8c5c6b1f3a@neratec.com> (raw)
In-Reply-To: <CAB+qc9CWOOTNruMhcAugmjhCne8a-FG9kk8X6ty8-Ss5CpKp5w@mail.gmail.com>
On 30/03/2020 18:49, Vaidas BoQsc wrote:
> Are there any ways to output only the local ipv4 (inet) addresses of
> the device using ip command?
>
> I tired this way and both UNKNOWN, Down are not filtered away. Is my
> usage of syntax incorrect?
>
> ip --brief address show up
> lo UNKNOWN 127.0.0.1/8 ::1/128
> enp7s0 DOWN
> wlp8s0 UP 192.168.0.103/24 fe80::22c:79e4:a646:a7b/64
>
> Even so, if enp7s0 and lo were filtered, I would still want an
> output of simply 192.168.0.103 from ip command which can't be provided
> without piping into other tools?
>
Hi
Is enp7s0 actually down, or does it just not plugged in?
Example:
ip -br l show wlan0
wlan0 DOWN b6:91:7e:4e:94:01
<NO-CARRIER,BROADCAST,MULTICAST,UP>
wlan0 is UP, but has NO-CARRIER, resulting in a state of DOWN.
To filter out ipv6 results, simply only request ipv4:
ip -4 -br a show up
BR
Matthias
prev parent reply other threads:[~2020-03-31 13:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-30 16:49 A robust correct way to display local ip addresses of the device Gautieji x Vaidas BoQsc
2020-03-31 13:08 ` Matthias May [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9910386d-deec-720a-fb2c-7c8c5c6b1f3a@neratec.com \
--to=matthias.may@neratec.com \
--cc=netdev@vger.kernel.org \
--cc=vaidas.boqsc@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).