Testing Network Connectivity in UEFI Shell
The UEFI Shell provides a powerful pre-boot environment for system
administration, hardware validation, and diagnostics before any
operating system loads. This article explains how to test network
connectivity directly from the UEFI Shell by identifying active network
interfaces, configuring IP parameters using DHCP or static assignment,
and utilizing network commands such as ifconfig and
ping to verify communication over supported UEFI networking
protocols.
1. Prerequisites and BIOS Configuration
Before testing the network in the UEFI Shell, ensure the platform's firmware network stack is enabled:
- Enter your system BIOS/UEFI setup.
- Navigate to the Network Stack or Advanced configuration menu.
- Enable Network Stack, as well as IPv4 PXE Support and/or IPv6 PXE Support.
- Save changes and boot into the UEFI Shell.
2. Identify Network Interfaces
Once in the UEFI Shell, check if the network drivers are loaded and locate the assigned network device names:
Shell> ifconfig -l
This command lists all available network interfaces (typically
designated as eth0, eth1, etc.) alongside
their MAC addresses and current configuration status.
If no interfaces appear, check whether the underlying Simple Network Protocol (SNP) and Universal Network Device Interface (UNDI) drivers are active:
Shell> drivers
Shell> devtree
Look for network controllers such as Intel (e1000e, igb) or Realtek
drivers. If the drivers are missing, they must be loaded manually via
the load command:
Shell> load fs0:\path\to\driver.efi
3. Configure the Network Interface
You must configure an interface with valid IP settings before transmitting packets.
Option A: Automatic Configuration via DHCP
To obtain an IP address automatically over IPv4:
Shell> ifconfig -s eth0 dhcp
Option B: Static IP Assignment
To assign a static IPv4 address, netmask, and default gateway:
Shell> ifconfig -s eth0 static <IP_ADDRESS> <SUBNET_MASK> <GATEWAY_IP>
Example:
Shell> ifconfig -s eth0 static 192.168.1.50 255.255.255.0 192.168.1.1
Verify Configuration
To confirm that the settings were applied correctly, display the interface details:
Shell> ifconfig -l eth0
The output displays the assigned IP address, subnet mask, gateway, and configuration method.
4. Test Connectivity with Ping
With the interface configured, use the ping utility to
test ICMP communication across the local subnet or out to an external
gateway:
Shell> ping -n 4 192.168.1.1
Command options:
-n <count>: Specifies the number of echo request packets to send (default is usually 10).-l <size>: Specifies the buffer size in bytes for the packet payload.
A successful response outputs round-trip times and a 0% packet loss summary, confirming that the physical link, UNDI driver, SNP layer, MNP (Managed Network Protocol), ARP, and IPv4 layers are functional.
5. Clear Configuration
After completing tests, release or clear the network settings if needed:
Shell> ifconfig -c eth0
This command clears the current static or DHCP-assigned configuration from the specified adapter.