Assigning an IP address may take a number of different strategies to make the process automatic and scalable. In this video, you’ll learn about the most important aspects of configuring an IP address, the differences between static and dynamic IP addressing, and how APIPA can be used when a DHCP server is not available.
If you’re responsible for configuring IP addresses on a device, you know there are a number of important parameters that you’ll need to add. One of these, of course, is the IP address itself. Every device needs a different IP address, and you may need to assign these manually or configure this IP address into the configuration of the service. So you may add, for example, 192.168.1.165. And now you’ve configured the IP address.
But, of course, you don’t have an IP address unless you also have a subnet mask. The subnet mask is used by that local device to determine which subnet it actually sits on. When we refer to an IP subnet, we’re referring to this combination of an IP address and a subnet mask.
A typical subnet mask might be 255.255.255.0. And since the subnet mask is not something that’s commonly sent across the network, we’ll need to get with the network administrator for that IP subnet to confirm that we have the correct subnet mask.
And if this device needs to communicate outside of this local subnet, they’ll need the IP address of the local router. This is often referred to as a default gateway. For example, the default gateway on this network might be 192.168.1.1. You’ll commonly be provided with all three of these by the network administrator, and this is what will give you the basic connectivity to communicate on your local subnet and outside of this local subnet.
There may be other parameters that you need to manually configure, such as DNS server configurations, NTP servers, voice over IP servers, and other important IP configuration parameters.
In an earlier video, we talked about DHCP, or the Dynamic Host Configuration Protocol, and how it’s used to automatically assign IP addresses on your devices. But there may be times when we don’t want to have our IP address pulled randomly from a DHCP pool. Instead, we would like the IP address for a device to always be that IP address.
We refer to this IP address that doesn’t change as a static IP address. One common way to assign a static IP address is to type it in manually on that device. You can usually find this in the configuration settings of this device, where you can input the IP address, the subnet mask, the gateway, a preferred DNS, and other important IP address configuration options.
This is one where we have to make sure that what we’re typing in is exactly correct, because this is not something that’s provided automatically. If we make a mistake typing this in, then this device won’t be able to communicate properly on the network.
But manually configuring IP addresses on all of your network devices can be time-consuming and difficult to manage. What if you’d like to change the IP address of your default gateway? Or what if the IP addresses of your DNS servers happens to change? You would have to manually go back to all of those devices and type in the new parameters.
That process may be something easy to manage if you have a handful of devices at home. But in a company where you have hundreds or even thousands of devices, manually configuring static IP addresses is not very scalable.
Generally speaking, manually configuring IP addresses is not the best practice, but there are ways to manually set static IP addresses on a device on the DHCP server itself. That’s a central point where you can manage all of these IP addresses, and it’s a configuration setting inside the DHCP server called a DHCP reservation.
This is a process that links the Mac address of this device to a specific IP address. So instead of configuring these manually, you would change that configuration setting to DHCP. This device will then access the DHCP server, find that there is a DHCP reservation, and always use the same static address because it has been administratively assigned on the DHCP server itself.
Now if you change the IP address of your default gateway or the IP addresses of your DNS servers change, you can figure that on your DHCP server. And the next time the system starts up, it will receive the new set of IP parameters without you having to manually visit that device.
Most of us rely on DHCP to provide that automatic IP addressing mechanism. If you’re working on a computer at home, at work, at a hotel, or a coffee shop, you’ve probably been assigned an IP address automatically using their local DHCP server.
But what if you’re on a network that doesn’t have a DHCP server and your system is configured to look for that DHCP configuration? In those situations, your device is not going to receive a DHCP address. And so it’s up to the device to determine what to do next.
In most cases, the operating system is going to assign an APIPA address. This stands for an Automatic Private IP Addressing scheme. We also refer to this as an IP version 4 link-local address. This is an IP address that allows you to communicate with other devices on your local IP address subnet, but it’s not able to route outside of your local subnet.
This means you might not have internet connectivity because you’re not able to route outside of your local subnet with an APIPA address, but you are able to communicate with other devices on your local subnet so that you can do some basic network troubleshooting and determine why you’re not able to communicate with the DHCP server.
The APIPA standard sets a block of addresses that could possibly be used for this link-local address. This is a very large range. It ranges between 169.254.0.0 through 169.254.255.255. This standard also reserves the first 256 addresses and the last 256 addresses, which means the IP address that you’ll receive on your device via APIPA will be 169.254.1.0 through 169.254.254.255.
If you look at the IP address on your device and you notice that it’s in this range, then you know your device has assigned itself an APIPA address. This also means that your DHCP server is probably not communicating, and you’ll need to troubleshoot that before you’re able to receive DHCP-assigned addresses again.
When your computer realizes that DHCP servers are not responding and it automatically assigns itself an APIPA address, it has to make sure that nobody else is using the random IP address that it chose in that very large block. To be able to make this determination, your device sends an ARP request out to the network, asking if any other device is currently using the IP address that it would like to use.
For example, your device could randomly choose 169.254.77.77. So it will send an ARP request to your local subnet with a broadcast that says, does anybody else out there have 169.254.77.77? And if it does not receive a response, it assumes that that address is available to use, and it will automatically assign that IP address to your local machine.
So if you’re currently using DHCP and you notice that occasionally the IP address of your device will change to a different IP, then you may want to set something that is more static. If you’re on a corporate network, then you’re probably using some type of static IP addressing already.
Your switches, your firewalls, your routers, and your printers are probably configured with a static IP address. You could, of course, disable DHCP on those devices and manually type in all of your IP address configuration settings.
But more commonly, we’ll use an IP reservation on the DHCP server, so that every time you start your router, your switch, your printer, or any of these other devices, they will automatically receive the same IP address from the DHCP server because you’ve configured an IP reservation.