How do I know if two machines are on same LAN? Announcing the arrival of Valued Associate...

Short Story with Cinderella as a Voo-doo Witch

How to call a function with default parameter through a pointer to function that is the return of another function?

How to find all the available tools in mac terminal?

Overriding an object in memory with placement new

What is a non-alternating simple group with big order, but relatively few conjugacy classes?

Extract all GPU name, model and GPU ram

Why am I getting the error "non-boolean type specified in a context where a condition is expected" for this request?

What is the meaning of the new sigil in Game of Thrones Season 8 intro?

Selecting the same column from Different rows Based on Different Criteria

How to run gsettings for another user Ubuntu 18.04.2 LTS

Dating a Former Employee

Why is "Consequences inflicted." not a sentence?

Bete Noir -- no dairy

Should I discuss the type of campaign with my players?

What exactly is a "Meth" in Altered Carbon?

How does debian/ubuntu knows a package has a updated version

Why are there no cargo aircraft with "flying wing" design?

Can an alien society believe that their star system is the universe?

Why aren't air breathing engines used as small first stages

How come Sam didn't become Lord of Horn Hill?

Is the Standard Deduction better than Itemized when both are the same amount?

If a contract sometimes uses the wrong name, is it still valid?

Is it ethical to give a final exam after the professor has quit before teaching the remaining chapters of the course?

Fundamental Solution of the Pell Equation



How do I know if two machines are on same LAN?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)two separate LAN over power lineHow should I reserve IP addresses for my home LAN?LAN tester shows two light at the same timeHow can I determine if there are two machines on the subnet with the same IP?access another computer in the same LAN of my laptop's routerConfiguring two routers, lan to lan or lan to wan?Connect two virtualbox machines on a same hostunable to bridge traffic from the same subnet of WAN & LANOne computer, Two LAN adapter, Two IP's in same subnet with DHCPTwo routers on same subnet





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







3















I am very poor with Computer Networks, even though I took class in my grad school.



I keep forgetting about subnets and masks and what not!



Currently, I am playing with Docker and Erlang and was trying to do distributed programming.



I started 4 docker containers



(gru@172.17.0.63) # also known as Server 
(minion1@172.17.0.61)
(minion2@172.17.0.64)
(minion3@172.17.0.65)


where numbers after @ are their respective IPs taken from ifconfig command.

Now given these IP addresses, how can I tell if they are on same LAN/network



If question is asked incorrectly or is stupid, my apologies, but I am stuck!



Thanks a lot










share|improve this question





























    3















    I am very poor with Computer Networks, even though I took class in my grad school.



    I keep forgetting about subnets and masks and what not!



    Currently, I am playing with Docker and Erlang and was trying to do distributed programming.



    I started 4 docker containers



    (gru@172.17.0.63) # also known as Server 
    (minion1@172.17.0.61)
    (minion2@172.17.0.64)
    (minion3@172.17.0.65)


    where numbers after @ are their respective IPs taken from ifconfig command.

    Now given these IP addresses, how can I tell if they are on same LAN/network



    If question is asked incorrectly or is stupid, my apologies, but I am stuck!



    Thanks a lot










    share|improve this question

























      3












      3








      3


      1






      I am very poor with Computer Networks, even though I took class in my grad school.



      I keep forgetting about subnets and masks and what not!



      Currently, I am playing with Docker and Erlang and was trying to do distributed programming.



      I started 4 docker containers



      (gru@172.17.0.63) # also known as Server 
      (minion1@172.17.0.61)
      (minion2@172.17.0.64)
      (minion3@172.17.0.65)


      where numbers after @ are their respective IPs taken from ifconfig command.

      Now given these IP addresses, how can I tell if they are on same LAN/network



      If question is asked incorrectly or is stupid, my apologies, but I am stuck!



      Thanks a lot










      share|improve this question














      I am very poor with Computer Networks, even though I took class in my grad school.



      I keep forgetting about subnets and masks and what not!



      Currently, I am playing with Docker and Erlang and was trying to do distributed programming.



      I started 4 docker containers



      (gru@172.17.0.63) # also known as Server 
      (minion1@172.17.0.61)
      (minion2@172.17.0.64)
      (minion3@172.17.0.65)


      where numbers after @ are their respective IPs taken from ifconfig command.

      Now given these IP addresses, how can I tell if they are on same LAN/network



      If question is asked incorrectly or is stupid, my apologies, but I am stuck!



      Thanks a lot







      networking lan ip-address subnet docker






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 19 '15 at 17:25









      daydreamerdaydreamer

      3103612




      3103612






















          2 Answers
          2






          active

          oldest

          votes


















          2














          You need to know the subnet mask. The subnet mask tells you which bits of the address represent the subnet, and which bits represent the host within the subnet. If you subnet is a /24 (255.255.255.0), then any address whose first three octets match would be in the same subnet.



          In your example, if your subnet mask is a /26 or longer (255.255.255.192 or higher), then those addresses would not be on the same subnet, because 63 would be the broadcast address of one subnet, and 64 would the the "network" address (0 for the host number) of another subnet. So those addresses probably wouldn't even work reliably as unicast host addresses if your subnet mask was /26 or longer.






          share|improve this answer































            1














            The IP alone is not enough to determine if it is on the same network. You need to use the subnet mask as well.



            An IP address is made up of four 8-bit octets; an octet is a sequence of 8 binary bits. Each bit therefore can be either a 0 or a 1, so each octet can represent 2^8 different values, which is 256 (0-255). Since there are four of these octets, there can be a combination of addresses equaling 28+8+8+8, or 232, which is 4,294,967,296 possible addresses. Each binary bit has a value: 128, 64, 32, 16, 8, 4, 2, 1, so depending on whether that binary bit is switched on or off, we either add or don’t add the value for that bit.



            The mask indicates the amount of addresses that we are ignoring. Basically, where there are 1s, there are addresses that are not a part of the group our address is in. For a /24 network (or network with mask of 255.255.255.0), it means that out of 2^32 possible addresses, we are subtracting 2^24 addresses, so we are left with 2^8 addresses in our group, or 256 of them.



            So if you had an address of 172.17.0.0/24, it means that you would have 256 addresses in that network, which would be 172.17.0.0-172.17.0.255, though some would be reserved as the network address (172.17.0.0) and one would be reserved as the broadcast address (172.17.0.255) and you'd also need a gateway (usually 172.17.0.1).






            share|improve this answer


























            • so each octet can represent 28 different values? How? 4 * 8(each octet) = 32

              – daydreamer
              Jan 19 '15 at 18:19











            • That got messed up in the copy-paste (from a doc I'm writing on subnetting). The formatting was a power, and it didn't translate in the paste and I didn't notice it to fix it. Should read 2^8, which is 256.

              – MaQleod
              Jan 19 '15 at 21:15














            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            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: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            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
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f866720%2fhow-do-i-know-if-two-machines-are-on-same-lan%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









            2














            You need to know the subnet mask. The subnet mask tells you which bits of the address represent the subnet, and which bits represent the host within the subnet. If you subnet is a /24 (255.255.255.0), then any address whose first three octets match would be in the same subnet.



            In your example, if your subnet mask is a /26 or longer (255.255.255.192 or higher), then those addresses would not be on the same subnet, because 63 would be the broadcast address of one subnet, and 64 would the the "network" address (0 for the host number) of another subnet. So those addresses probably wouldn't even work reliably as unicast host addresses if your subnet mask was /26 or longer.






            share|improve this answer




























              2














              You need to know the subnet mask. The subnet mask tells you which bits of the address represent the subnet, and which bits represent the host within the subnet. If you subnet is a /24 (255.255.255.0), then any address whose first three octets match would be in the same subnet.



              In your example, if your subnet mask is a /26 or longer (255.255.255.192 or higher), then those addresses would not be on the same subnet, because 63 would be the broadcast address of one subnet, and 64 would the the "network" address (0 for the host number) of another subnet. So those addresses probably wouldn't even work reliably as unicast host addresses if your subnet mask was /26 or longer.






              share|improve this answer


























                2












                2








                2







                You need to know the subnet mask. The subnet mask tells you which bits of the address represent the subnet, and which bits represent the host within the subnet. If you subnet is a /24 (255.255.255.0), then any address whose first three octets match would be in the same subnet.



                In your example, if your subnet mask is a /26 or longer (255.255.255.192 or higher), then those addresses would not be on the same subnet, because 63 would be the broadcast address of one subnet, and 64 would the the "network" address (0 for the host number) of another subnet. So those addresses probably wouldn't even work reliably as unicast host addresses if your subnet mask was /26 or longer.






                share|improve this answer













                You need to know the subnet mask. The subnet mask tells you which bits of the address represent the subnet, and which bits represent the host within the subnet. If you subnet is a /24 (255.255.255.0), then any address whose first three octets match would be in the same subnet.



                In your example, if your subnet mask is a /26 or longer (255.255.255.192 or higher), then those addresses would not be on the same subnet, because 63 would be the broadcast address of one subnet, and 64 would the the "network" address (0 for the host number) of another subnet. So those addresses probably wouldn't even work reliably as unicast host addresses if your subnet mask was /26 or longer.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 19 '15 at 17:42









                SpiffSpiff

                78.5k10119165




                78.5k10119165

























                    1














                    The IP alone is not enough to determine if it is on the same network. You need to use the subnet mask as well.



                    An IP address is made up of four 8-bit octets; an octet is a sequence of 8 binary bits. Each bit therefore can be either a 0 or a 1, so each octet can represent 2^8 different values, which is 256 (0-255). Since there are four of these octets, there can be a combination of addresses equaling 28+8+8+8, or 232, which is 4,294,967,296 possible addresses. Each binary bit has a value: 128, 64, 32, 16, 8, 4, 2, 1, so depending on whether that binary bit is switched on or off, we either add or don’t add the value for that bit.



                    The mask indicates the amount of addresses that we are ignoring. Basically, where there are 1s, there are addresses that are not a part of the group our address is in. For a /24 network (or network with mask of 255.255.255.0), it means that out of 2^32 possible addresses, we are subtracting 2^24 addresses, so we are left with 2^8 addresses in our group, or 256 of them.



                    So if you had an address of 172.17.0.0/24, it means that you would have 256 addresses in that network, which would be 172.17.0.0-172.17.0.255, though some would be reserved as the network address (172.17.0.0) and one would be reserved as the broadcast address (172.17.0.255) and you'd also need a gateway (usually 172.17.0.1).






                    share|improve this answer


























                    • so each octet can represent 28 different values? How? 4 * 8(each octet) = 32

                      – daydreamer
                      Jan 19 '15 at 18:19











                    • That got messed up in the copy-paste (from a doc I'm writing on subnetting). The formatting was a power, and it didn't translate in the paste and I didn't notice it to fix it. Should read 2^8, which is 256.

                      – MaQleod
                      Jan 19 '15 at 21:15


















                    1














                    The IP alone is not enough to determine if it is on the same network. You need to use the subnet mask as well.



                    An IP address is made up of four 8-bit octets; an octet is a sequence of 8 binary bits. Each bit therefore can be either a 0 or a 1, so each octet can represent 2^8 different values, which is 256 (0-255). Since there are four of these octets, there can be a combination of addresses equaling 28+8+8+8, or 232, which is 4,294,967,296 possible addresses. Each binary bit has a value: 128, 64, 32, 16, 8, 4, 2, 1, so depending on whether that binary bit is switched on or off, we either add or don’t add the value for that bit.



                    The mask indicates the amount of addresses that we are ignoring. Basically, where there are 1s, there are addresses that are not a part of the group our address is in. For a /24 network (or network with mask of 255.255.255.0), it means that out of 2^32 possible addresses, we are subtracting 2^24 addresses, so we are left with 2^8 addresses in our group, or 256 of them.



                    So if you had an address of 172.17.0.0/24, it means that you would have 256 addresses in that network, which would be 172.17.0.0-172.17.0.255, though some would be reserved as the network address (172.17.0.0) and one would be reserved as the broadcast address (172.17.0.255) and you'd also need a gateway (usually 172.17.0.1).






                    share|improve this answer


























                    • so each octet can represent 28 different values? How? 4 * 8(each octet) = 32

                      – daydreamer
                      Jan 19 '15 at 18:19











                    • That got messed up in the copy-paste (from a doc I'm writing on subnetting). The formatting was a power, and it didn't translate in the paste and I didn't notice it to fix it. Should read 2^8, which is 256.

                      – MaQleod
                      Jan 19 '15 at 21:15
















                    1












                    1








                    1







                    The IP alone is not enough to determine if it is on the same network. You need to use the subnet mask as well.



                    An IP address is made up of four 8-bit octets; an octet is a sequence of 8 binary bits. Each bit therefore can be either a 0 or a 1, so each octet can represent 2^8 different values, which is 256 (0-255). Since there are four of these octets, there can be a combination of addresses equaling 28+8+8+8, or 232, which is 4,294,967,296 possible addresses. Each binary bit has a value: 128, 64, 32, 16, 8, 4, 2, 1, so depending on whether that binary bit is switched on or off, we either add or don’t add the value for that bit.



                    The mask indicates the amount of addresses that we are ignoring. Basically, where there are 1s, there are addresses that are not a part of the group our address is in. For a /24 network (or network with mask of 255.255.255.0), it means that out of 2^32 possible addresses, we are subtracting 2^24 addresses, so we are left with 2^8 addresses in our group, or 256 of them.



                    So if you had an address of 172.17.0.0/24, it means that you would have 256 addresses in that network, which would be 172.17.0.0-172.17.0.255, though some would be reserved as the network address (172.17.0.0) and one would be reserved as the broadcast address (172.17.0.255) and you'd also need a gateway (usually 172.17.0.1).






                    share|improve this answer















                    The IP alone is not enough to determine if it is on the same network. You need to use the subnet mask as well.



                    An IP address is made up of four 8-bit octets; an octet is a sequence of 8 binary bits. Each bit therefore can be either a 0 or a 1, so each octet can represent 2^8 different values, which is 256 (0-255). Since there are four of these octets, there can be a combination of addresses equaling 28+8+8+8, or 232, which is 4,294,967,296 possible addresses. Each binary bit has a value: 128, 64, 32, 16, 8, 4, 2, 1, so depending on whether that binary bit is switched on or off, we either add or don’t add the value for that bit.



                    The mask indicates the amount of addresses that we are ignoring. Basically, where there are 1s, there are addresses that are not a part of the group our address is in. For a /24 network (or network with mask of 255.255.255.0), it means that out of 2^32 possible addresses, we are subtracting 2^24 addresses, so we are left with 2^8 addresses in our group, or 256 of them.



                    So if you had an address of 172.17.0.0/24, it means that you would have 256 addresses in that network, which would be 172.17.0.0-172.17.0.255, though some would be reserved as the network address (172.17.0.0) and one would be reserved as the broadcast address (172.17.0.255) and you'd also need a gateway (usually 172.17.0.1).







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Jan 19 '15 at 21:15

























                    answered Jan 19 '15 at 17:42









                    MaQleodMaQleod

                    12.3k43156




                    12.3k43156













                    • so each octet can represent 28 different values? How? 4 * 8(each octet) = 32

                      – daydreamer
                      Jan 19 '15 at 18:19











                    • That got messed up in the copy-paste (from a doc I'm writing on subnetting). The formatting was a power, and it didn't translate in the paste and I didn't notice it to fix it. Should read 2^8, which is 256.

                      – MaQleod
                      Jan 19 '15 at 21:15





















                    • so each octet can represent 28 different values? How? 4 * 8(each octet) = 32

                      – daydreamer
                      Jan 19 '15 at 18:19











                    • That got messed up in the copy-paste (from a doc I'm writing on subnetting). The formatting was a power, and it didn't translate in the paste and I didn't notice it to fix it. Should read 2^8, which is 256.

                      – MaQleod
                      Jan 19 '15 at 21:15



















                    so each octet can represent 28 different values? How? 4 * 8(each octet) = 32

                    – daydreamer
                    Jan 19 '15 at 18:19





                    so each octet can represent 28 different values? How? 4 * 8(each octet) = 32

                    – daydreamer
                    Jan 19 '15 at 18:19













                    That got messed up in the copy-paste (from a doc I'm writing on subnetting). The formatting was a power, and it didn't translate in the paste and I didn't notice it to fix it. Should read 2^8, which is 256.

                    – MaQleod
                    Jan 19 '15 at 21:15







                    That got messed up in the copy-paste (from a doc I'm writing on subnetting). The formatting was a power, and it didn't translate in the paste and I didn't notice it to fix it. Should read 2^8, which is 256.

                    – MaQleod
                    Jan 19 '15 at 21:15




















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • 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%2fsuperuser.com%2fquestions%2f866720%2fhow-do-i-know-if-two-machines-are-on-same-lan%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

                    Cannot install PyQt5 The Next CEO of Stack OverflowCannot install tcpreplay 3.4.4cannot...

                    Kapp-Putsch Acontecimentos | Outros artigos | Menu de navegação

                    Why did early computer designers eschew integers? The Next CEO of Stack OverflowWhat register...