Find the answer to your Linux question:
Results 1 to 6 of 6
I have a file in which I have stored all the network e.g. 10.53.50.0/23 10.53.54.0/23 10.160.92.0/24 10.160.250.0/24 10.151.88.0/23 10.156.54.0/25 10.51.144.0/22 10.51.50.0/23 10.62.8.0/21 10.53.26.128/25 10.53.27.128/25 10.200.10.0/21 Now I want to find ...
  1. #1
    Linux Newbie
    Join Date
    Jan 2008
    Posts
    114

    How to find IP belongs to which network?

    I have a file in which I have stored all the network e.g.

    10.53.50.0/23
    10.53.54.0/23
    10.160.92.0/24
    10.160.250.0/24
    10.151.88.0/23
    10.156.54.0/25
    10.51.144.0/22
    10.51.50.0/23
    10.62.8.0/21
    10.53.26.128/25
    10.53.27.128/25
    10.200.10.0/21

    Now I want to find IP belongs to which network from abobe file and if more than one ips belongs to the same network than I want to know that those IPs.

    Is there any way to do?
    Switched to Scripting

  2. #2
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    Every one of those subnets is RFC 1918 private IP space.

  3. #3
    Linux Newbie
    Join Date
    Jan 2008
    Posts
    114
    I did not get you.

    My question is "I want to know the network of that IP from above mentioned list"
    Switched to Scripting

  4. #4
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    Is there any way to do?
    Sure - you need to understand what part of the IP is the "network address" and which part is the "node address." You have each network already listed - expand each one out and you'll see if any overlap.

    10.53.50.0/23 => Network address that includes all nodes from 10.53.50.0 > 10.53.51.255
    10.53.54.0/23 => Includes all nodes from 10.53.54.0 > 10.53.55.255

    And keep going...just glancing over the list, it doesn't appear any overlap.

  5. #5
    Linux Newbie
    Join Date
    Jan 2008
    Posts
    114
    Could you please explain more about this "it doesn't appear any overlap"

    and above list is just an example I have bigger list.
    Switched to Scripting

  6. #6
    Just Joined!
    Join Date
    Jul 2007
    Posts
    2
    I don't know how do this.
    But I know the DNS server --bind 9 have the capabiltiy you mentioned above.
    Perhaps you can get some tips form soruce code of bind 9 (The "view" function).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...