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

893 questions
88
votes
4 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
  • 995
  • 2
  • 8
  • 10
63
votes
4 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
  • 2,165
  • 3
  • 23
  • 36
47
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,676
  • 10
  • 53
  • 63
45
votes
9 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
  • 8,284
  • 5
  • 33
  • 47
32
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
  • 329
  • 1
  • 4
  • 4
30
votes
8 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
  • 19,820
  • 8
  • 25
  • 19
22
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
  • 19,008
  • 67
  • 180
  • 294
22
votes
6 answers

How to check if IP is in one of these subnets

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 subnets…
Steve
  • 5,823
  • 7
  • 31
  • 33
20
votes
5 answers

See all resources in a subnet / See if subnet is in use

I am trying to clean up my AWS configuration and I want to know if particular subnets are actually used/have any resources in them. I'm aware you can filter a list of a particular resource type (e.g. EC2 instances) by subnet id, through the AWS web…
Dr.Seuss
  • 1,598
  • 3
  • 16
  • 20
19
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
  • 18,696
  • 24
  • 83
  • 112
18
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
1 answer

More than 1 subnet per AZ for AWS Interface Endpoint?

Can I supply more than 1 subnet per AZ to create an AWS Interface Endpoint? When I tried, I got this error: Error creating VPC Endpoint: DuplicateSubnetsInSameZone: Found another VPC endpoint subnet in the availability zone of subnet-xxx. VPC…
Tri Nguyen
  • 9,950
  • 8
  • 40
  • 72
18
votes
7 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,903
  • 4
  • 31
  • 34
17
votes
2 answers

AWS best practice: shall I have a NAT gateway in each AZ?

Since NAT gateway only have redundancy within a single AZ, if I want to have a public/private pair of subnets in every AZ for the purpose of multi-AZ redundancy, I should have a NAT gateway in every AZ, shouldn't I? Otherwise, if I have only one…
user788454
16
votes
4 answers

Azure Subnet - Your subnet is not contained within the same address space for this virtual network

I Virtual Network has the following subnet 10.0.0.0/24 and I want to add another but each time I try I get: "Your subnet is not contained within the same address space for this virtual network" How do I add another subnet?
TJ1
  • 161
  • 1
  • 1
  • 3
1
2 3
59 60