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
7
votes
2 answers

List IP all addresses in a subnet

I need to get all of the IP addresses contained in within a subnet and I'm trying to do it using IPnetwork For example the subnet 192.168.1.0/29 would have the following output: // Output // 192.168.1.0 // 192.168.1.1 …
Ray Womack
  • 1,010
  • 1
  • 9
  • 12
7
votes
1 answer

Standard/safe way to check if IP address is in range/subnet

I have a small piece of code that converts a 32-bit unsigned integer (ie: uint32_t) into a set of four 8-bit fields, treats it like an IP address, and then reports to the client if it falls within a predetermined range of IP addresses. I've already…
Cloud
  • 18,753
  • 15
  • 79
  • 153
7
votes
5 answers

Function for subnet mask

I have a subnet mask as a value in an object. It comes in the long form, ie. 255.255.255.0 (for /24). I haven't come across some sort of JavaScript function for calculating this. So before I write a whole lot of if and else if statements, I want to…
misterbear
  • 803
  • 2
  • 13
  • 33
7
votes
7 answers

Given an IP address and subnetmask, how do I calculate the CIDR?

Ok I can't seem to figure this out: given the following: IP address = 192.168.1.0 Subnetmask = 255.255.255.240 Using c#, how do I calculate the CIDR notation 192.168.1.0/28 ? Is there an easy way to achieve this? Am I missing something? Thanks!
RoelF
  • 7,483
  • 5
  • 44
  • 67
7
votes
2 answers

Get IP Mask from IP Address and Mask Length in Python

Given an IP Address in dotted quad notation, for example: 192.192.45.1 And a mask length for example 8, 16, 24 typically, but could be anything i.e. 17. Can somebody please provide the code in python to calculate the subnet mask? Preferably…
themaestro
  • 13,750
  • 20
  • 56
  • 75
6
votes
4 answers

For UDP broadcast gurus: Problems achieving high-bandwidth audio UDP broadcast over WiFi (802.11N and 802.11G)

I'm attempting to send multichannel audio over WiFi from one server to multiple client computers using UDP broadcast on a private network. I'm using software called Pure Data, with a UDP broadcast tool called netsend~ and netreceive~. The code is…
Nick
  • 61
  • 1
  • 2
6
votes
5 answers

How to store IP address list in C# List to make it searchable for subnets too?

How should I correctly store IP address list with addresses which are subnets to make it searchable? There are two examples: I have IP address 1.2.3.4 and in my C# List there is 1.2.3.4 entry so here we have no problems. I have IP address 3.4.5.6…
GrZeCh
  • 2,332
  • 8
  • 29
  • 38
5
votes
2 answers

How to query the subnet mask(s) using Mono on Linux?

In my application (admin web interface written in MVC3) running on open-embedded Linux I have to list all the TCP/IP settings. This includes IP-Adresse, Gateway and the subnet mask. The following code runs well under MS .Net but Mono 2.10 throws a…
Marc
  • 4,715
  • 3
  • 27
  • 34
5
votes
2 answers

Why can't a subnet span availability zones in AWS?

In AWS a VPC subnet can only reside in one availability zone. I'm curious what's the reason behind this restriction. I don't know how AWS implements VPC under the hood. But usually VPC implementation is based on overlay network, such as VXLAN. Take…
5
votes
2 answers

Can't connect to a public accessible AWS RDS

I was running a serverless web application on a lambda inside a VPC, and connecting to a Aurora-MySQL RDS instance, with inbound rules to allow traffic from the security group of the lambda The connection was working fine, however, quite often the…
dfranca
  • 5,156
  • 2
  • 32
  • 60
5
votes
1 answer

AWS EKS deploy to multiple VPC's

I'm a bit confused about how aws EKS works, excuse me for my ignorance. I have 4 VPC's one for shared services(gitlab ect..), one for dev, one for staging and one for prod. There are multiple subnets on each vpc for different clients a,b,c.…
bink1time
  • 383
  • 1
  • 5
  • 15
5
votes
1 answer

no matching subnet found for vpc with id vpc

I am using data resources (Terraform .12) to find the subnet_id within the vpc and finally create ec2 instance. The VPC is getting created succesfully but I get the following error : Error: no matching subnet found for vpc with id…
Judi
  • 710
  • 3
  • 10
  • 25
5
votes
1 answer

Using a non conventional subnet mask

A normal mask for example; 255.255.255.0 this gives us 1111 1111.1111 1111.1111 1111.0000 0000 binary where ones represent network id, and zeroes represent host id. Would it be possible to use a layout which doesn't have all ones to the left and…
Filip Haglund
  • 13,919
  • 13
  • 64
  • 113
5
votes
1 answer

AWS Public Subnet Internet Access for Non Public IP Instances

I have a public subnet in AWS and I have 3 instances in it ... WebApp01 (Elastic IP - 54.23.61.239 for example) WebApp02 (Private IP - 192.168.0.24) WebApp03 (Private IP - 192.168.0.25) And my route table is setup as 192.168.0.0/16 ->…
Tarunpreet Ubhi
  • 405
  • 1
  • 3
  • 18
5
votes
1 answer

how to find Subnetmask,gateway,DNS values of ethernet connection in android device?

I have android PC device ,handheld device which are connected through Ethernet connection. Right now i am able to get IP address and mac address of device but i also need to get the subnet mask,gateway, pri-sec DNS values. Please anyone tell me how…
shyam002
  • 237
  • 1
  • 5
  • 19