[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9910386d-deec-720a-fb2c-7c8c5c6b1f3a@neratec.com>
Date: Tue, 31 Mar 2020 15:08:36 +0200
From: Matthias May <matthias.may@...atec.com>
To: Vaidas BoQsc <vaidas.boqsc@...il.com>, netdev@...r.kernel.org
Subject: Re: A robust correct way to display local ip addresses of the device
Gautieji x
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
Powered by blists - more mailing lists