Questions tagged [subnet]

A part of the IP address identifying the whole local network (high bits as defined by netmask). The remainder of the IP address (host id) identifies devices that are connected to this network. Can also mean the local network itself, if addressed by IP address in a described way.

Read more on wikipedia: https://en.wikipedia.org/wiki/Subnetwork

741 questions
67
votes
3 answers

What is VPC, Subnet in AWS

What are AWS VPCs (virtual private clouds)? What practical purposes do they serve? Is it mandatory to launch instances within a VPC? What are the subnets and why are they necessary? Do subnets correspond to a particular region?
Santosh Dhanasure
  • 735
  • 1
  • 6
  • 8
43
votes
4 answers

IP Subnet Notation

On a lab to regarding network topology using port scanners, I am instructed "to develop a network inventory and topology for the 123.218.44.0/24 subnet." What does the notation 0/24 mean there? I had assumed it meant to consider the network range…
JoshJordan
  • 12,079
  • 9
  • 50
  • 63
37
votes
7 answers

How to check if an IP address is within a particular subnet

I have a subnet in the format 10.132.0.0/20 and an IP address from the ASP.Net request object. Is there a .NET framework function to check to see if the IP address is within the given subnet? If not, how can it be done? Bit manipulation, I guess?
Ryan Michela
  • 7,744
  • 5
  • 31
  • 47
26
votes
5 answers

How can I determine network and broadcast address from the IP address and subnet mask?

For example: IP Address: 130.45.34.36 Mask: 255.255.240.0 What would be Net ID/Subnet Address, and Broadcast Address?
Apprentice
  • 269
  • 1
  • 3
  • 4
25
votes
2 answers

AWS VPC identify private and public subnet

I have a VPC in AWS account and there are 5 subnets associated with that VPC. Subnets are of 2 types - Public and private. How to identify which subnet is public and which is private ? Each subnet has CIDR 10.249.?.? range. Basically when I launch…
user1846749
  • 1,255
  • 2
  • 14
  • 28
25
votes
7 answers

Python 3: create a list of possible ip addresses from a CIDR notation

I have been handed the task of creating a function in python (3.1) that will take a CIDR notation and return the list of possible ip addresses. I have looked around python.org and found this: http://docs.python.org/dev/py3k/library/ipaddr.html but…
MadSc13ntist
  • 15,070
  • 7
  • 23
  • 18
21
votes
9 answers

Generate Random IP Address

I want to generate some random IP Address. But evertime this generateIPAddress function returns 0.0.0.0 string as ipAddress. But it should be returning some random ipAddress other than 0.0.0.0 everytime. Any suggestions why is it happening? private…
AKIWEB
  • 16,538
  • 58
  • 164
  • 276
21
votes
6 answers

JavaScript: Is IP In One Of These Subnets?

So I have ~12600 subnets: eg. 123.123.208.0/20 and an IP. I can use a SQLite Database or an array or whatever There was a similar question asked about a month ago, however I am not looking for checking one IP against one subnet but a bunch of…
Steve
  • 5,483
  • 7
  • 29
  • 33
19
votes
5 answers

Calculate broadcast address from ip and subnet mask

I want to calculate the broadcast address for: IP: 192.168.3.1 Subnet: 255.255.255.0 = 192.168.3.255 in C. I know the way (doing fancy bitwise OR's between the inversed IP and subnet), but my problem is I come from the green fields of…
Kolja
18
votes
3 answers

Is there native .NET type for CIDR subnets?

It's simple enough to code up a class to store/validate something like 192.168.0.0/16, but I was curious if a native type for this already existed in .NET? I would imagine it would work a lot like IPAddress: CIDR subnet =…
Neil C. Obremski
  • 15,617
  • 20
  • 62
  • 90
17
votes
6 answers

Given the IP and netmask, how can I calculate the network address using bash?

In a bash script I have an IP address like 192.168.1.15 and a netmask like 255.255.0.0. I now want to calculate the start address of this network, that means using the &-operator on both addresses. In the example, the result would be 192.168.0.0.…
Christian
  • 2,735
  • 4
  • 28
  • 32
16
votes
3 answers

Calculating range of IPs from subnet mask

Say, I have a subnet of 255.255.255.242 and I have a known IP within that subnet say 192.168.1.101. Now the way I calculate the range of IPs is this: In the subnet mask, find the first octet that is not a 255. In my example, its the 4th octet, and…
dig_123
  • 1,863
  • 6
  • 29
  • 48
14
votes
4 answers

Java check if IPv4 or IPv6 address is in a given subnet

How can I check if an IP address is in a given subnet? I was able to do this by using Apache Commons SubnetUtils (SubnetUtils.SubnetInfo.isInRange) but it does not support IPv6 yet.
Jan H
  • 3,529
  • 3
  • 22
  • 33
13
votes
4 answers

AWS - Accessing instances in private subnet using EIP

I want to access a few instances in my private subnet using EIPs. Is there a way? I know it doesn't make much sense. But let me explain in detail. I have a VPC with 2 subnets. 1) 192.168.0.0/24 (public subnet) has EIPs attached to it 2)…
tuxtoti
  • 133
  • 1
  • 1
  • 7
13
votes
2 answers

How to get subnet mask using .net?

I want to get client subnet mask using c#. How can I get it?
BrMe
  • 305
  • 2
  • 8
  • 21
1
2 3
49 50