ip is the new ifconfig

# show all network interfaces (physical and virtual) and their properties
ip address show
# or in short:
ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: enp0s25: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 28:d2:44:c4:36:11 brd ff:ff:ff:ff:ff:ff
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 28:b2:bd:28:99:b6 brd ff:ff:ff:ff:ff:ff
    inet 192.168.123.23/24 brd 192.168.123.255 scope global dynamic noprefixroute wlp3s0
       valid_lft 862904sec preferred_lft 862904sec
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:1f:ae:38 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:1f:ae:38 brd ff:ff:ff:ff:ff:ff

tested and works across the following systems:


hostnamectl; # tested on
  Operating System: Debian GNU/Linux 10 (buster)
            Kernel: Linux 4.19.0-17-amd64
      Architecture: x86-64
uname -a
Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.39-1+deb8u2 (2017-03-07) i686 GNU/Linux

uname -a
Linux centos 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

uname -a
Linux suse 4.4.21-69-default #1 SMP Tue Oct 25 10:58:20 UTC 2016 (9464f67) x86_64 x86_64 x86_64 GNU/Linux

examples & scripts:

to get a more “alive” version of what is going on network wise, a while loop is always nice 🙂

vim /scripts/network_show_live.sh

can be run as non-root user/a lot of network info for non-root users of a system:

#!/bin/bash

while true; do
	echo -e "===== showing all network interfaces ====="
	ip a s;

	echo -e "\n===== showing all routes ====="
	ip route;

	echo -e "\n===== showing all nameservers ====="
	cat /etc/resolv.conf

	sleep 3;
	clear;
done;

sample output:

cool (root only) tools to show network connections and traffic per ip address:

su - root
apt update
apt install iftop

manpage: iftop.man.txt

apt install iptstate

manpage: iptstate.man.txt

example output:

ipv6:

# show ipv6 address without clutter
# make sure to replace eth0 with user's ip6 enabled network interface
ip addr show dev eth0 | sed -e's/^.*inet6 \([^ ]*\)\/.*$/\1/;t;d';

while on servers ipv6 should stay enabled, it does not need to be enabled on (most) clients

https://dwaves.de/2016/08/12/gnu-linux-how-to-system-wide-disable-turn-off-ip6-and-use-ip4-only/

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin