subnet

How to calculate the AND operation of an IPaddress and a subnet mask in C?

I have an IPaddress and subnet mask, both in unsigned long; how can I AND both of these and check whether my incoming ipaddress (ip2) belongs to the same subnet or not? like: if (ip1 & subnet == ip2 & subnet) then same subnet. ...

How to determine the subnet mask of a network using the minimum number of ICMP echo requests?

How to determine the subnet mask of a network using the minimum number of ICMP echo requests? ...

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! ...

Identify machines behind a router uniquely based on ipaddress

Some background first. I have a .net client agent installed on each of the machines in the lan. They are interacting with my central server [website] also on the same lan. It is important for my website to figure out which of the machines can talk to each other. For example, machines of one subnet cannot directly talk to machines of ano...

python 3: ipaddr/netaddr modules

I have got to be doing something wrong here... I am at present trying to validate whether an ip is within a specific subnet utilizing a builtin module. I am using activepython: ActivePython 3.1.2.3 (ActiveState Software Inc.) based on Python 3.1.2 (r312:79147, Mar 22 2010, 12:20:29) [MSC v.1500 32 bit (Intel)] on win32 which has th...

Calculate directed broadcast address given IP address and subnet in PowerShell

My goal is to calculate the directed broadcast address when given the IP and subnet mask of a host node. I know, sounds like homework. Once I reasoned through my task and boiled it down to this, I was amused with myself. Anyway, the solution will look something like the one in this question I suppose, but I'm not a math major and my C su...

How do I get the IPv4 subnetmask on interface with both v4 and v6 address?

I have an InterfaceAddress that returns an ipv4 address (4 octets). However the network prefix length seems to be for the ipv6 address associated with the interface (it's returning as 128). How do I find the correct network prefix length? Enumeration<NetworkInterface> NetworkInterface.getNetworkInterfaces() for (; interfaces.hasMoreElem...

Converting subnet mask "/" notation to Cisco 0.0.0.0 standard

Hi there, I've searched SO for help but could'nt find a answer to my question. Situation: I need to convert a "/NN" subnet mask notation (think IPTABLES) to a 0.0.0.0 cisco notation. NN are the number of "1" in the submask, from the lowest octet to the higher. Each octet are 8 bit integers. Possible solution: Make a array of 32 "0"...

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 http://ipnetwork.codeplex.com/. For example the subnet 192.168.1.0/29 would have the following output: // Output // 192.168.1.0 // 192.168.1.1 // 192.168.1.2 // 192.168.1.3 // 192.168.1.4 ...

HTML - make some pages only accessible through IntrAnet \ some SUBNET

i have certain pages in my website that i would like to only be accessed from the LAN which is within my organization... now those pages are a part of my website because they interact with the database and all... how to do it Now i can make them password protected... but i want to make them inaccessible to the rest of the internet and o...

Is IP address on the same subnet as the local machine (with IPv6 support)

Does anyone have some code that will determine if an IP address (IPv4 or IPv6) is on the same subnet as the machine running the application? I've seen numerous examples of code that does this with IPv4 but I can't find any that support IPv6. ...

what is benefit of CIDR?

Hi, What is the basic usage of CIDR in networking and also give me the benefit over SubNetting. ...

Static Routing with Subnet Mask 255.255.255.255 and Blank Gateway ?

Greetings Overflowers, What static route configuration (as shown by command line "route PRINT"): Network Destination Netmask Gateway Interface Metric could be used to reach a specified static route (web proxy) in the Intranet, giving that: Subnet Mask = 255.255.255.255 Gateway = BLANK for a computer in a flat LAN. I tried Netma...