How to determine whether two IP addresses are on the same network segment?

Updated on technology 2024-03-18
6 answers
  1. Anonymous users2024-02-06

    1. Subnet mask.

    is a 32-bit address, and the subnet mask is used to mask the IP address.

    to distinguish between the network identity and the host identity, and to indicate whether the IP address is on a local area network or a remote network. The general IP address settings are as follows.

    2. The method of finding the network identity is as follows: binary the subnet mask.

    Binary to IP address "AND".

    <>4. To determine whether the two IP addresses are in the same network segment, it is to compare the network identifier (network address, if the network identifier is the same, it is in the same subnet, otherwise, it is not in the same subnet.

  2. Anonymous users2024-02-05

    The subnet mask is all 16-bit, that is. The first 24 bits of both IPs are the same, so they are on the same network segment.

    The subnet masks are all 24-bit, that is. The first 24 bits of the two IPs are not the same, one is the other is not the same segment.

    One subnet mask is 16-bit and the other is 24-bit. At this time, it is the same network segment as it. And for the pair and it is not a network segment.

  3. Anonymous users2024-02-04

    1. Two IPs are in the same subnet, which means that they are in the same network segment, mainly to see if their network identifiers are the same.

    2. Next, let's take an example to show whether A and B IP addresses are on the same network segment.

    a ip:b ip:

    Subnet mask: A: 1100 1001

    b:1100 1101

    Mask : 1111 1111 1111 1111 .0000 0000

    4. To judge whether two IPs are in the same network segment, the main thing is to see if their network identifiers are the same, in fact, the network identifier of an IP is the junction after his IP and subnet mask and - for example, the results of the above two and after are as follows:

    0000 .0000 0000 to decimal:

    b:1100 0000 to decimal:

    This means that the network identity of the two IP addresses is the same, that is, they are in the same subnet.

    5. Sometimes we still want to know the respective host identifiers of the two IPs, first reverse the subnet mask, and then do And. with the IP

    a:1100 1001

    b:1100 1101

    Mask negation: 0000 1111

    6, and after the result:

    a: 0000 1001 to decimal: 9

    b: 0000 1101 is converted to decimal: 14

    That is, the host IDs of A and B are 9 and 14.

  4. Anonymous users2024-02-03

    How to communicate IP addresses between different CIDR blocks:

    The first method is to change the subnet mask to the same network segment.

    The CIDR blocks of two different subnets cannot reach each other, and after changing the original subnet mask to the subnet mask, both are in the same network segment, and they can access each other.

    The second method requires a Layer 3 switch or router.

    The device in the left subnet uses the interface IP of the router connected to as the gateway, and the device in the right subnet uses the interface IP of the router as the gateway, and the two subnets can communicate.

    Communication principle: There are direct routes to two subnets on the router, and when the subnet device uses the router as the gateway, it can directly access the target according to the direct route, and the router is the gateway when the target is returned, and the direct route is also directly called to return the information.

    The third method: there are multiple isolation devices in between.

    The two adjacent subnets use the adjacent router interfaces as gateways, and the two routers write static routes to each other's subnets. Alternatively, two routers can run the dynamic routing protocol and advertise the routes of the subnets where they are located.

    This is a general, three-layer communication environment, which is no different from communication on the Internet.

    The public address is the responsibility of the Inter NIC (Internet Network Information Center). These IP addresses are assigned to organizations that register and apply to Inter NIC. Direct access to the Internet through it.

    2. Private address.

    A private address is a non-registered address that is intended for internal use within an organization.

    Class A, Class B, Class C.

  5. Anonymous users2024-02-02

    How to determine whether two IP addresses are in the same network segment?

    To determine whether the two IP addresses are in the same network segment, their IP addresses are respectively compared with the subnet mask, and the result is a network number, if the network number is the same, it is in the same subnet, otherwise, it is not in the same subnet.

    The result of the WITH is:

    The result of the WITH is:

    It can be seen that the result (which is the network address) is the same, so it can be judged that the two IP addresses are in the same subnet.

    Step 1, translate the IP address to binary 11000000

    Step 2, convert the subnet mask to a binary 11111111

    In the third step, the above two binary number logic is combined with (and), and the result is the network part. “11000000

    00001101" and "11111111

    00000000" and "get 110000000".

    00000000", that is", this is the network number of this IP address, or "network address".

    Step 4: After inverting the binary value of the subnet mask, and then perform the AND (and) operation with the IP address, the result is the host part. For example, replace "00000000

    11111111 (the value of the subnet mask) is inverse to 110000000

    00001101 "000000000" is obtained after performing and arithmetic

    00001101", i.e., ", this is the IP address host number (which can be shortened to "13").

    Three of the host bits are classified as "network identification numbers", because the network identification numbers should all be "1", so the byte segment corresponding to the host number is "11100000". After converting to decimal to 224, this finalizes the subnet mask. If it is a Class C network, the subnet mask is; In the case of a Class B network, the subnet mask is; If it is a Class A network, the subnet mask is.

  6. Anonymous users2024-02-01

    In this case, the CIDR block of the IP address is related to the subnet mask. The IP address is a 32-bit binary number, and the subnet mask is the same, which is a 32-bit binary value. Usually the value of the subnet mask is how many bits are 1 in front and 0 in the end.

    For example, this subnet mask is 1 for the first 24 bits and 0 for the last 8 bitsWhen distinguishing network segments, match the IP address and subnet mask so that when there is a numeric value, the same value is the same CIDR block.

Related questions
8 answers2024-03-18

First of all, I want to tell you that there is --- a route that exists specifically for the end line offload. If you don't add something in the case of the existing setup, there is a way to achieve it, but it is relatively unreliable, and it has its drawbacks, which I will explain later. 1) Two routers are connected to two cats, and they are configured according to the normal single line. >>>More

13 answers2024-03-18

Love is not to judge, but to experience, if a person truly loves you, it can be experienced, love is not a matter of a year or two, nor is it to say that chasing you for three months is sure that this person is in love with you, not to say so, love is mutual, if you don't love him, no matter how great love will be diluted by time, unilateral pay can not be exchanged for long-term happiness, only pay is rewarded, this is the unchanging truth of thousands of years. You can't be lazy in love

10 answers2024-03-18

I think judging whether a relationship is sincere, she should be reflected in the process of daily communication, if she is very friendly to you in daily communication, and then often ask you out to play, or go out to dinner or something, it should be a certain impression of you, at least there is no feeling of disgust, if you have feelings for him, you can take certain actions, you have a chance of success. Also, if you meet a more cheerful girl, you may take the initiative to confess to you, but the chance is too small.

14 answers2024-03-18

It is relatively easy to see that a person has a good impression of you, from the small details. For example, if you inadvertently turn around, you will find that his eyes have been on you, and then just right, the two of you meet eye contact, and he will immediately look away. Of course, there are some braver and sultry little brothers who will smile sweetly at you, and then your little heart will flutter and turn around with a smile. >>>More

7 answers2024-03-18

A good entrepreneurial project must have these conditions: small investment, large return, high profit, low risk, and great potential, all of which are indispensable! Let's break them down one by one. >>>More