How to understand ifconfig or ip addr show [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












The ifconfig command dumps a lot of information at you, especially if you have a lot of interfaces, and you don't know where they come from. I've read through this tutorial page, which gives a great rundown on most of the information in ifconfig. But it doesn't contain all the information I want (and could also be outdated by 12 years).



Using ip addr show eth0:



2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:e2:80:18 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0 valid_lft forever preferred_lft forever



I find it tough to parse some of the output.



  • Under eth0:


    • <...> describes... the interface capabilities? Uncertain where I can find the full set of options, uncertain what they're called, no idea what to google. What're the other options?


    • state UP - I know there's also state DOWN and state RUNNING. These are all software constructs, right? Nothing is physically changing when I run ip link set dev eth0 down, right? So how does the kernel act differently when this state changes? does this state changes?


    • group default - interface groups. What is the unique problem they solve?


  • Under inet

    • What does scope global mean - How can a private IP have a global scope? What am I missing?







share|improve this question












closed as too broad by Ipor Sircer, Jeff Schaller, Isaac, SivaPrasath, countermode Aug 30 at 9:55


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


















    up vote
    0
    down vote

    favorite












    The ifconfig command dumps a lot of information at you, especially if you have a lot of interfaces, and you don't know where they come from. I've read through this tutorial page, which gives a great rundown on most of the information in ifconfig. But it doesn't contain all the information I want (and could also be outdated by 12 years).



    Using ip addr show eth0:



    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:e2:80:18 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0 valid_lft forever preferred_lft forever



    I find it tough to parse some of the output.



    • Under eth0:


      • <...> describes... the interface capabilities? Uncertain where I can find the full set of options, uncertain what they're called, no idea what to google. What're the other options?


      • state UP - I know there's also state DOWN and state RUNNING. These are all software constructs, right? Nothing is physically changing when I run ip link set dev eth0 down, right? So how does the kernel act differently when this state changes? does this state changes?


      • group default - interface groups. What is the unique problem they solve?


    • Under inet

      • What does scope global mean - How can a private IP have a global scope? What am I missing?







    share|improve this question












    closed as too broad by Ipor Sircer, Jeff Schaller, Isaac, SivaPrasath, countermode Aug 30 at 9:55


    Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      The ifconfig command dumps a lot of information at you, especially if you have a lot of interfaces, and you don't know where they come from. I've read through this tutorial page, which gives a great rundown on most of the information in ifconfig. But it doesn't contain all the information I want (and could also be outdated by 12 years).



      Using ip addr show eth0:



      2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
      link/ether 08:00:27:e2:80:18 brd ff:ff:ff:ff:ff:ff
      inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0 valid_lft forever preferred_lft forever



      I find it tough to parse some of the output.



      • Under eth0:


        • <...> describes... the interface capabilities? Uncertain where I can find the full set of options, uncertain what they're called, no idea what to google. What're the other options?


        • state UP - I know there's also state DOWN and state RUNNING. These are all software constructs, right? Nothing is physically changing when I run ip link set dev eth0 down, right? So how does the kernel act differently when this state changes? does this state changes?


        • group default - interface groups. What is the unique problem they solve?


      • Under inet

        • What does scope global mean - How can a private IP have a global scope? What am I missing?







      share|improve this question












      The ifconfig command dumps a lot of information at you, especially if you have a lot of interfaces, and you don't know where they come from. I've read through this tutorial page, which gives a great rundown on most of the information in ifconfig. But it doesn't contain all the information I want (and could also be outdated by 12 years).



      Using ip addr show eth0:



      2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
      link/ether 08:00:27:e2:80:18 brd ff:ff:ff:ff:ff:ff
      inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0 valid_lft forever preferred_lft forever



      I find it tough to parse some of the output.



      • Under eth0:


        • <...> describes... the interface capabilities? Uncertain where I can find the full set of options, uncertain what they're called, no idea what to google. What're the other options?


        • state UP - I know there's also state DOWN and state RUNNING. These are all software constructs, right? Nothing is physically changing when I run ip link set dev eth0 down, right? So how does the kernel act differently when this state changes? does this state changes?


        • group default - interface groups. What is the unique problem they solve?


      • Under inet

        • What does scope global mean - How can a private IP have a global scope? What am I missing?









      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 29 at 17:55









      Ari Sweedler

      508




      508




      closed as too broad by Ipor Sircer, Jeff Schaller, Isaac, SivaPrasath, countermode Aug 30 at 9:55


      Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






      closed as too broad by Ipor Sircer, Jeff Schaller, Isaac, SivaPrasath, countermode Aug 30 at 9:55


      Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          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.






          share|improve this answer






















          • Interesting. So "private/public" for IPs and "scope" for IPs are on different layers, just like "port" and "IP" are on different layers. I see that 127.0.0.1 has scope host lo, meaning it is not global. What are the benefits of restricting an IP address's scope to an interface/local link?
            – Ari Sweedler
            Aug 29 at 19:44










          • On ubuntu, ifconfig yields Scope:link for eth0 and Scope:host for loopback. There is no scope specified for docker0 - so you don't need a scope to be reachable? On MacOS, I see "scopeid" as a single digit hex number.
            – Ari Sweedler
            Aug 29 at 19:47

















          up vote
          3
          down vote













          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.






          share|improve this answer



























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote



            accepted










            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.






            share|improve this answer






















            • Interesting. So "private/public" for IPs and "scope" for IPs are on different layers, just like "port" and "IP" are on different layers. I see that 127.0.0.1 has scope host lo, meaning it is not global. What are the benefits of restricting an IP address's scope to an interface/local link?
              – Ari Sweedler
              Aug 29 at 19:44










            • On ubuntu, ifconfig yields Scope:link for eth0 and Scope:host for loopback. There is no scope specified for docker0 - so you don't need a scope to be reachable? On MacOS, I see "scopeid" as a single digit hex number.
              – Ari Sweedler
              Aug 29 at 19:47














            up vote
            2
            down vote



            accepted










            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.






            share|improve this answer






















            • Interesting. So "private/public" for IPs and "scope" for IPs are on different layers, just like "port" and "IP" are on different layers. I see that 127.0.0.1 has scope host lo, meaning it is not global. What are the benefits of restricting an IP address's scope to an interface/local link?
              – Ari Sweedler
              Aug 29 at 19:44










            • On ubuntu, ifconfig yields Scope:link for eth0 and Scope:host for loopback. There is no scope specified for docker0 - so you don't need a scope to be reachable? On MacOS, I see "scopeid" as a single digit hex number.
              – Ari Sweedler
              Aug 29 at 19:47












            up vote
            2
            down vote



            accepted







            up vote
            2
            down vote



            accepted






            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.






            share|improve this answer














            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.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Aug 29 at 19:38

























            answered Aug 29 at 19:22









            Johan Myréen

            6,94711423




            6,94711423











            • Interesting. So "private/public" for IPs and "scope" for IPs are on different layers, just like "port" and "IP" are on different layers. I see that 127.0.0.1 has scope host lo, meaning it is not global. What are the benefits of restricting an IP address's scope to an interface/local link?
              – Ari Sweedler
              Aug 29 at 19:44










            • On ubuntu, ifconfig yields Scope:link for eth0 and Scope:host for loopback. There is no scope specified for docker0 - so you don't need a scope to be reachable? On MacOS, I see "scopeid" as a single digit hex number.
              – Ari Sweedler
              Aug 29 at 19:47
















            • Interesting. So "private/public" for IPs and "scope" for IPs are on different layers, just like "port" and "IP" are on different layers. I see that 127.0.0.1 has scope host lo, meaning it is not global. What are the benefits of restricting an IP address's scope to an interface/local link?
              – Ari Sweedler
              Aug 29 at 19:44










            • On ubuntu, ifconfig yields Scope:link for eth0 and Scope:host for loopback. There is no scope specified for docker0 - so you don't need a scope to be reachable? On MacOS, I see "scopeid" as a single digit hex number.
              – Ari Sweedler
              Aug 29 at 19:47















            Interesting. So "private/public" for IPs and "scope" for IPs are on different layers, just like "port" and "IP" are on different layers. I see that 127.0.0.1 has scope host lo, meaning it is not global. What are the benefits of restricting an IP address's scope to an interface/local link?
            – Ari Sweedler
            Aug 29 at 19:44




            Interesting. So "private/public" for IPs and "scope" for IPs are on different layers, just like "port" and "IP" are on different layers. I see that 127.0.0.1 has scope host lo, meaning it is not global. What are the benefits of restricting an IP address's scope to an interface/local link?
            – Ari Sweedler
            Aug 29 at 19:44












            On ubuntu, ifconfig yields Scope:link for eth0 and Scope:host for loopback. There is no scope specified for docker0 - so you don't need a scope to be reachable? On MacOS, I see "scopeid" as a single digit hex number.
            – Ari Sweedler
            Aug 29 at 19:47




            On ubuntu, ifconfig yields Scope:link for eth0 and Scope:host for loopback. There is no scope specified for docker0 - so you don't need a scope to be reachable? On MacOS, I see "scopeid" as a single digit hex number.
            – Ari Sweedler
            Aug 29 at 19:47












            up vote
            3
            down vote













            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.






            share|improve this answer
























              up vote
              3
              down vote













              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.






              share|improve this answer






















                up vote
                3
                down vote










                up vote
                3
                down vote









                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.






                share|improve this answer












                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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Aug 29 at 17:55









                Ari Sweedler

                508




                508












                    Comments

                    Popular posts from this blog

                    Long meetings (6-7 hours a day): Being “babysat” by supervisor

                    Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                    Confectionery