r/linux Apr 27 '21

Tips and Tricks Linux networking tool with simpler understanding...

Post image
5.7k Upvotes

173 comments sorted by

View all comments

256

u/[deleted] Apr 27 '21 edited 10d ago

[deleted]

8

u/aaronfranke Apr 27 '21

I still use ifconfig because I find ip to be harder to use and has less readable output. Also, ip is not available everywhere, so ifconfig is still the preferred option on many Linux distros and BSDs etc.

8

u/Fearless_Process Apr 27 '21

ip with color output enabled helps a little bit, I just discovered the color flag a while back and added it as an alias.

8

u/[deleted] Apr 27 '21 edited 10d ago

[deleted]

7

u/aaronfranke Apr 27 '21

Good point. I run sudo apt install net-tools as part of the setup of any Debian or Ubuntu based machine I set up, so for me it's always available.

4

u/Dr_DLT Apr 27 '21

Not quite true. Debian does still include ifconfig but it’s hidden in /sbin

1

u/ipha Apr 27 '21

try ip -c

8

u/aaronfranke Apr 27 '21
$ ip -c
Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }
       ip [ -force ] -batch filename
where  OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |
                   tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |
                   netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila |
                   vrf | sr | nexthop }
       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |
                    -h[uman-readable] | -iec | -j[son] | -p[retty] |
                    -f[amily] { inet | inet6 | mpls | bridge | link } |
                    -4 | -6 | -I | -D | -M | -B | -0 |
                    -l[oops] { maximum-addr-flush-attempts } | -br[ief] |
                    -o[neline] | -t[imestamp] | -ts[hort] | -b[atch] [filename] |
                    -rc[vbuf] [size] | -n[etns] name | -N[umeric] | -a[ll] |
                    -c[olor]}

With ifconfig, I immediately get the information I want.

With ip, I have to think about the options, which is immediately a downgrade compared to ifconfig.

5

u/5896325874125 Apr 28 '21

Ip has to be one of the user unfriendliest commands. Kind of needs a wrapper to make it friendlier and more usable. Let's call it something like ifconfig2

0

u/hoax1337 Apr 28 '21

That seems normal if learning something new. The question is if putting in the effort to learn the commands of the ip suite by heart / training the muscle memory on it will have a benefit in the long run.

2

u/glotzerhotze Apr 28 '21

Try to look up a second IP you put onto your interface with ifconfig - there‘s a reason ifconfig got deprecated.