I would like to know how to get the mask of a network interface.With ifconfig it is very simple, but I have to use the ip tool, and ip addr show is not showing me what I want.Here is an example output of ip addr:1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00    inet 127.0.0.1/8 scope host lo    inet6 ::1/128 scope host        valid_lft forever preferred_lft foreverAlso, what is that brd field?
Show netmask using ip tool
ip;network interface
The subnet mask in CIDR notation (for example /8) represents the bits used for the subnet mask.The 'old' way of 255.255.255.0 shows you 4 bytes of 8 bits each. A typical subnet mask for the loopback address 127.0.0.1 is 255.0.0.0. This means that one byte (8 bits) is fully used as the subnet mask. It is written as the /8 in 127.0.0.1/8. Another often used subnet is 192.168.0.0. The default subnet mask is 255.255.255.0. From this you can read that 3 bytes consisting of 8 bits each is used for the subnet mask. Those 3 bytes x 8 bits equals to 24. Such a network is written as 192.168.0.0/24. If you are presented with an address like 192.168.0.1/24 you know that 24 bits are used for the subnetmask.