How to understand ifconfig or ip addr show

Here're the parts that I can already parse, for reference for anyone else with the same question.

  • eth0 is the interface name. It can be any string:
    • mtu 1500 maximum transmission unit = 1500 bytes, this is the largest size that a frame sent over this interface can be. This number is usually limited by the Ethernet protocol's cap of 1500. If you send a larger packet and it arrives at an ethernet interface, then the frame will get fragmented and its payload transmitted in 2 or more packets. Not really any benefit to that, so it's best to follow standards.
    • qdiscpfifo_fast queuing discipline = three pipes of first in first out, this determines how an interface chooses which packet to transmit next, when it's being overloaded.
    • group default Interface groups give a single interface to clients by combining the capabilities of the aggregated interfaces on them.
    • qlen 1000 transmission queue length = 1000 packets. The 1000th packet will be queued, the 1001st will be dropped.
  • link/ether means the link layer protocol is ethernet:
    • brd means broadcast. This is the address that the device will set as destination when it sends a broadcast. An interface sees all traffic on the wire it's sitting on, but is polite enough to only read data addressed to it. The way you address an interface is by using it's specific address, or the broadcast address.
  • inet means the network layer protocol is internet (ipv4)
    • lft stands for lifetime. If you get this address through dhcp, then you'll have a valid lifetime for your lease on the IP address. And just to make handoffs a little bit easier, a (probably) shorter preferred lifetime.

Addresses with global scope are global from the point of view of the host, i.e. they are not restricted to the host or the local link. The host does not care, and does nothing different, in the case the address falls within the ranges specified in RFC1819 (Address Allocation for Private Internets). The "private" addresses are private only by convention. The host does not care which router does NAT, and how many hops away from the host the address translation from private to public addresses is done. Besides, you can implement NAT with other addresses too.

Tags:

Ifconfig