Things I tried:
scope inetgivesError: argument "inet" is wrong: invalid "scope"to inetgivesError: ??? prefix is expected rather than "inet".- (flag)
inetgivesError: either "dev" is duplicate, or "inet" is a garbage. label inetgives no output- List item
And thats exhausted my ideas. Is there even a built in way to get interface properties without a nasty grep 🙳 grok pipeline?
How Can I Get My Interface's IP (inet) Address?
How can I get the ipv4 (inet) field alone directly from the iproute2 tools ip command?
I was trying to the effect of:
ip address show dev docker0 [magical argument here]
But I dont think I really understand the options here:
ip address show [ dev IFNAME ] [ scope SCOPE-ID ]
[ to PREFIX ] [ FLAG-LIST ] [ label LABEL ] [up]
— $ ip address show help
ip a show dev $INTERFACE– ILMostro_7 Mar 30 '17 at 18:05grep,awk,perlor whatever you like to extract the ip address proper from the output. Keep in mind that interfaces can have multiple ip addresses. – dirkt Mar 31 '17 at 05:42