Subnetting is essentially creating smaller networks or subnetworks from a single large IP network.Īs you may be aware, an IPV4 address is composed of 32 bits, divided into a network part and a host ID. Here’s a refresher course/cheat sheet to help you out. But keeping the subnet IDs, subnet masks, and addresses all in your head can be a bit tricky. VLANs and VXLANs are one way of doing this.Īnother way of creating smaller networks is subnetting. Keeping the devices separate also reduces the IT security risks for your organization. It reduces network collisions and computing demands from the devices and improves efficiency and improves the user experience. High latency can affect the user experience and security measures can have costly impacts on the organization.Īnd splitting the organization’s assets into different networks instead of one single large network achieves this. If the subnet masks are not all the same, namely 255.0.0.0, 255.255.0.0 or 255.255.255.0, I think it is best to use a user-defined function to apply the subnet masks to the IP addresses.Network engineers are constantly looking for ways to improve the security and efficiency of their IT networks. ' one time, creating addition columns in myTableįunction convertIP(ip As Variant) As Longĭim ip32 As Long, ip32sign As Long, i As Long ' option: it would be better to do the conversions For example:įunction subnetName(ip As String, myTable As Range)ĭim ip32 As Long, subnet32 As Long, mask32 As Long If the subnet masks are not all the same, namely 255.0.0.0, 255.255.0.0 or 255.255.255.0, I think it is best to use a user-defined function to apply the subnet masks to the IP addresses. And use IFERROR to capture any mismatches, if you are using Excel 2007 or later and you do not require Excel 2003 compatibility. If we cannot, do not use 1 for the last MATCH parameter. In any case, I assume that we can expect an exact match. That could make for a much faster lookup if the number of subnets is large.īut if the subnets might be ambiguous, it is more important to put the subnet addresses is "routing order", and use 0 for the last MATCH parameter. Sort order, which is not the same as numerical order. The last MATCH parameter can be 1 if the subnet address in column B are in If so, we could use lookup functions without having to actually apply a subnet mask, albeit messy.įor example, if the table of subnet name and address are in A2:B2000 and the IP address to look up is in X1, then the following returns the subnet name: However, we would need the routing table or the equivalent if there are any ambiguous subnets, since the routing table provides an order of precedence.īut for a different reason, I, too, was wondering: are all the subnet masks are 255.255.255.0? That is unambiguous with respect to the IP addresses 16.1.2.3 and 10.1.2.3
If you mean to say that all the subnet masks must have the same length, I believe that is incorrect.įor example, we can have subnet 16.1.0.0 with mask 255.255.0.0 and subnet 10.1.2.0 with mask 255.255.255.0. Asadulla wrote: Subnet Mask length is fixed ? Otherwise one IP can belong to several subnet