Easily find IPv4 address












1















For a long time I've used ipconfig in Windows, and ifconfig in Unix to find out my local IPv4, for different purposes.



There are times when your screen is small, or you have an extensive amount of network adapters connected to your computer, making this list really extensive. I know you can pipe it into less, in order to avoid scrolling, and filter with grep, but that's rather cumbersome.



I was wondering if there was an easier way to find the basic information your DHCP provides you (gateway, IPv4, and subnet mask), without having to squint your eyes in order to find the numbers you are looking for, and without having to look up a command in your notes or Google.










share|improve this question







New contributor




mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    1















    For a long time I've used ipconfig in Windows, and ifconfig in Unix to find out my local IPv4, for different purposes.



    There are times when your screen is small, or you have an extensive amount of network adapters connected to your computer, making this list really extensive. I know you can pipe it into less, in order to avoid scrolling, and filter with grep, but that's rather cumbersome.



    I was wondering if there was an easier way to find the basic information your DHCP provides you (gateway, IPv4, and subnet mask), without having to squint your eyes in order to find the numbers you are looking for, and without having to look up a command in your notes or Google.










    share|improve this question







    New contributor




    mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      1












      1








      1








      For a long time I've used ipconfig in Windows, and ifconfig in Unix to find out my local IPv4, for different purposes.



      There are times when your screen is small, or you have an extensive amount of network adapters connected to your computer, making this list really extensive. I know you can pipe it into less, in order to avoid scrolling, and filter with grep, but that's rather cumbersome.



      I was wondering if there was an easier way to find the basic information your DHCP provides you (gateway, IPv4, and subnet mask), without having to squint your eyes in order to find the numbers you are looking for, and without having to look up a command in your notes or Google.










      share|improve this question







      New contributor




      mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      For a long time I've used ipconfig in Windows, and ifconfig in Unix to find out my local IPv4, for different purposes.



      There are times when your screen is small, or you have an extensive amount of network adapters connected to your computer, making this list really extensive. I know you can pipe it into less, in order to avoid scrolling, and filter with grep, but that's rather cumbersome.



      I was wondering if there was an easier way to find the basic information your DHCP provides you (gateway, IPv4, and subnet mask), without having to squint your eyes in order to find the numbers you are looking for, and without having to look up a command in your notes or Google.







      linux networking ip






      share|improve this question







      New contributor




      mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 hour ago









      mazunkimazunki

      62




      62




      New contributor




      mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          2 Answers
          2






          active

          oldest

          votes


















          0














          An easy way to see your IPv4 addresses is:



          ip -c address -- The -c parameter adds colour to the IP addresses, so you can easily find it. It's easy to remember, and short.



          I usually use ip -4 -c -o address, since I am only interested in IPv4s, and not IPv6, and I personally prefer to see each adapter in one line. This also facilitates piping into grep without much trouble.



          You can calculate your subnet mask out from the (default) /24 after the IP, but I don't know if there is any easy way to see it. The same goes for the default gateway, if it is known that it is located on the first IP address, as it usually is.






          share|improve this answer








          New contributor




          mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




























            0














            ip addr - list IPv4 and IPv6 addresses



            ip -4 addr - list only IPv4 addresses (ip -c -4 addr for color)



            ip -6 addr - list only IPv6 addresses (ip -c -6 addr for color)



            ip route - IPv4 routing table



            ip -6 route - IPv6 routing table






            share|improve this answer








            New contributor




            user84215 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.




















              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "106"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });






              mazunki is a new contributor. Be nice, and check out our Code of Conduct.










              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f504163%2feasily-find-ipv4-address%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              An easy way to see your IPv4 addresses is:



              ip -c address -- The -c parameter adds colour to the IP addresses, so you can easily find it. It's easy to remember, and short.



              I usually use ip -4 -c -o address, since I am only interested in IPv4s, and not IPv6, and I personally prefer to see each adapter in one line. This also facilitates piping into grep without much trouble.



              You can calculate your subnet mask out from the (default) /24 after the IP, but I don't know if there is any easy way to see it. The same goes for the default gateway, if it is known that it is located on the first IP address, as it usually is.






              share|improve this answer








              New contributor




              mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.

























                0














                An easy way to see your IPv4 addresses is:



                ip -c address -- The -c parameter adds colour to the IP addresses, so you can easily find it. It's easy to remember, and short.



                I usually use ip -4 -c -o address, since I am only interested in IPv4s, and not IPv6, and I personally prefer to see each adapter in one line. This also facilitates piping into grep without much trouble.



                You can calculate your subnet mask out from the (default) /24 after the IP, but I don't know if there is any easy way to see it. The same goes for the default gateway, if it is known that it is located on the first IP address, as it usually is.






                share|improve this answer








                New contributor




                mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.























                  0












                  0








                  0







                  An easy way to see your IPv4 addresses is:



                  ip -c address -- The -c parameter adds colour to the IP addresses, so you can easily find it. It's easy to remember, and short.



                  I usually use ip -4 -c -o address, since I am only interested in IPv4s, and not IPv6, and I personally prefer to see each adapter in one line. This also facilitates piping into grep without much trouble.



                  You can calculate your subnet mask out from the (default) /24 after the IP, but I don't know if there is any easy way to see it. The same goes for the default gateway, if it is known that it is located on the first IP address, as it usually is.






                  share|improve this answer








                  New contributor




                  mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.










                  An easy way to see your IPv4 addresses is:



                  ip -c address -- The -c parameter adds colour to the IP addresses, so you can easily find it. It's easy to remember, and short.



                  I usually use ip -4 -c -o address, since I am only interested in IPv4s, and not IPv6, and I personally prefer to see each adapter in one line. This also facilitates piping into grep without much trouble.



                  You can calculate your subnet mask out from the (default) /24 after the IP, but I don't know if there is any easy way to see it. The same goes for the default gateway, if it is known that it is located on the first IP address, as it usually is.







                  share|improve this answer








                  New contributor




                  mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered 1 hour ago









                  mazunkimazunki

                  62




                  62




                  New contributor




                  mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  mazunki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.

























                      0














                      ip addr - list IPv4 and IPv6 addresses



                      ip -4 addr - list only IPv4 addresses (ip -c -4 addr for color)



                      ip -6 addr - list only IPv6 addresses (ip -c -6 addr for color)



                      ip route - IPv4 routing table



                      ip -6 route - IPv6 routing table






                      share|improve this answer








                      New contributor




                      user84215 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.

























                        0














                        ip addr - list IPv4 and IPv6 addresses



                        ip -4 addr - list only IPv4 addresses (ip -c -4 addr for color)



                        ip -6 addr - list only IPv6 addresses (ip -c -6 addr for color)



                        ip route - IPv4 routing table



                        ip -6 route - IPv6 routing table






                        share|improve this answer








                        New contributor




                        user84215 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.























                          0












                          0








                          0







                          ip addr - list IPv4 and IPv6 addresses



                          ip -4 addr - list only IPv4 addresses (ip -c -4 addr for color)



                          ip -6 addr - list only IPv6 addresses (ip -c -6 addr for color)



                          ip route - IPv4 routing table



                          ip -6 route - IPv6 routing table






                          share|improve this answer








                          New contributor




                          user84215 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.










                          ip addr - list IPv4 and IPv6 addresses



                          ip -4 addr - list only IPv4 addresses (ip -c -4 addr for color)



                          ip -6 addr - list only IPv6 addresses (ip -c -6 addr for color)



                          ip route - IPv4 routing table



                          ip -6 route - IPv6 routing table







                          share|improve this answer








                          New contributor




                          user84215 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          share|improve this answer



                          share|improve this answer






                          New contributor




                          user84215 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          answered 28 mins ago









                          user84215user84215

                          1




                          1




                          New contributor




                          user84215 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.





                          New contributor





                          user84215 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






                          user84215 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






















                              mazunki is a new contributor. Be nice, and check out our Code of Conduct.










                              draft saved

                              draft discarded


















                              mazunki is a new contributor. Be nice, and check out our Code of Conduct.













                              mazunki is a new contributor. Be nice, and check out our Code of Conduct.












                              mazunki is a new contributor. Be nice, and check out our Code of Conduct.
















                              Thanks for contributing an answer to Unix & Linux Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f504163%2feasily-find-ipv4-address%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              宮崎県

                              濃尾地震

                              シテ島