Affiliate Disclosure: As an Amazon Associate I earn from qualifying purchases.
An IP address is assigned to each device that joins the network, so is it the network switch itself that assigns the addresses, or does it serve a completely different purpose?
Network switches are not able to assign IP addresses due to them not having DHCP capabilities. DHCP is performed by the router with it assigning IP addresses to the devices that connect to the network. Without DHCP in place, static IP addresses will need to be set to allow for communication.
Although network switches don’t assign IP addresses in a home network, some switches themselves can actually be assigned an IP address, and it is possible for more than one device connected to a single switch to have the same IP address.
Does the Network Switch Itself Have an IP Address?
If network switches are unable to assign IP addresses on a home network due to them not having DHCP capabilities, is the switch itself assigned an IP address by the router’s DHCP server?
Basic unmanaged and layer 2 network switches do not get assigned IP addresses, whereas managed and layer 3 switches do. This is because an IP address is required for Telnet which allows for remote management of the switch.
The main reason for some network switches having an IP address is to allow you a method of actually being able to access it.
Without it having an IP address assigned that you can browse to in a web browser, you won’t have any way of being able to access the switch and configure it.
Although unmanaged switches are basic plug-and-play devices and don’t require any configuration whatsoever, managed switches do need some setting up before you can begin using them.
This makes an IP address essential for these types of switches; it’s not as if you can plug in a monitor, mouse, and keyboard and configure it through a graphical user interface.
Having an IP address assigned is also one of the prerequisites for Telnet, which is another method that can be used to connect to the switch, and from there, configure or manage it.
The use of Telnet has declined over recent years in favor of an alternative called SSH (Secure Shell). This is because of some security concerns around the use of Telnet as it lacks data encryption and authentication policies; something you don’t really want to be using on an open network.
Once the switch has been configured, it doesn’t necessarily need an IP address assigned to it in order to continue functioning, although it is unlikely that it will lose its address given the role that it plays within the network.
How Do Devices Connected to a Network Switch Get an IP Address?
When a device boots up, it will look for a DHCP server to assign it an IP address which will allow it to communicate with other devices on the same network.
It sends a broadcast traffic request, with it essentially asking each device it can already contact who the DHCP server is.
The DHCP server then responds to the request, with the router itself often acting as the DHCP server in a home network.
Regardless of how a device is connecting to the network, it will always be the DHCP server’s responsibility to assign IP addresses, unless static addresses are set on the individual devices themselves.
Should there not be a DHCP server present on the network for whatever reason, a Windows device can optionally assign itself a unique Class B IP address within the ranges of 169.254.0.0 and 169.254.255.255.
Microsoft refer to this process as Automatic Private Internet Protocol Addressing (APIPA).
The reason for this self-assigning of local-link addresses is to allow for that device to communicate with other hosts found within the same subnet, even without any external address configuration taking place.
For most people at home, receiving a local-link address when the DHCP server is not contactable is more of a hindrance than a benefit.
Having a device with an IP address that is outside of the expected subnet will not only prevent it from communicating with the other devices but is also likely to cause confusion and make troubleshooting more difficult.
The Windows device not receiving an IP address at all would be more beneficial for home users, but unfortunately, this is not the case.
Will Devices Connected to a Network Switch Have a Different IP Address?
Devices being connected via a network switch will not influence which IP address they receive. This is again down to the switch itself not having DHCP capabilities.
Regardless of how a device connects to your network, be it directly to the router using ethernet, Wi-Fi, powerline networking, or via a network switch or wireless access point, it is still the responsibility of the DHCP server to assign IP addresses.
The method in which a device connects to the network has no influence on the IP address that gets assigned.
This is unless the devices are members of different VLANs, in which case they can appear to have the same IP address.
VLANs form layer 2 networks that are independent of one another, which is the entire purpose of a VLAN.
Devices, or hosts, within a VLAN cannot be seen by other hosts that are members of a different VLAN, providing the VLANs haven’t been bridged and there isn’t any routing in place to connect them.
As an example, let’s assume we have four PCs:
- PC A has an IP address of 220.127.116.11
- PC B has an IP address of 192.168.0.20
- PC C has an IP address of 192.168.0.10
- PC D has an IP address of 192.168.0.20
PC A and PC B are members of VLAN 1 whereas PC C and PC D are members of VLAN 2.
In this scenario, PC A and PC C share the same IP address of 192.168.0.10, and PC B and PC D share the same IP address of 192.168.0.20.
Given that they belong to the same VLAN, PC A and PC B can communicate with each other. The same applies to PC C and PC D.
Now as they belong to different VLANs, PC A and PC B will not be able to communicate with PC C and PC D, but they can be assigned the same IP addresses.
When VLANs are used, it is almost like two networks are formed that are completely separate from each other, allowing the same IP address to be used on both.
Unless they have been set up in a specific way, in which case the same IP address cannot be used, each VLAN will not know that the other even exists.