Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

“ifconfig: command not found” has two common causes: the legacy net-tools package is not installed, or ifconfig exists in /sbin or /usr/sbin but those directories are missing from your PATH. Check both before changing anything. For new network work, Linux distributions generally prefer the iproute2 command, especially ip addr and ip link.

Find out whether ifconfig is missing or merely hidden

1. Ask the shell to locate it

command -v ifconfig
type -a ifconfig

If either command prints a path, the shell can already find ifconfig. If there is no output, check the usual administrative directories directly:

/sbin/ifconfig
/usr/sbin/ifconfig

If one of those commands displays interface information, the executable is installed and this is a PATH problem. If both return “No such file or directory,” install the package that provides the traditional command.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Check your distribution

cat /etc/os-release

Use the package-manager command for the distribution family shown by that file. Do not try to install a package literally named ifconfig; the traditional implementation is supplied by net-tools.

Install ifconfig with the correct package manager

Distribution family Command Notes
Debian, Ubuntu, Mint, Pop!_OS, Raspberry Pi OS sudo apt update && sudo apt install net-tools Updates package metadata, then installs the package.
Fedora, RHEL, CentOS, Rocky, AlmaLinux sudo dnf install net-tools Older CentOS releases may use sudo yum install net-tools.
Arch, Manjaro sudo pacman -S net-tools Confirm the installation when prompted.
Alpine sudo apk add net-tools Use the command inside the Alpine environment where you need it.
openSUSE sudo zypper install net-tools-deprecated Verify that package name against your exact openSUSE release before running it.

After installation, open a new shell and verify:

command -v ifconfig
ifconfig -a

The -a option asks for all interfaces, including ones that are currently down. Without an interface argument, ifconfig displays active interfaces; with an interface argument, it can configure that interface.

Fix a PATH problem without reinstalling anything

If /sbin/ifconfig or /usr/sbin/ifconfig worked in the first test, add the directory containing it to the current shell’s path:

export PATH="$PATH:/sbin:/usr/sbin"
command -v ifconfig
ifconfig -a

This change lasts only until that shell exits. To make it persistent, add the same export line to the startup file used by your shell (for example, ~/.bashrc for interactive Bash sessions), then start a new shell. System-wide path policy is normally managed by files under /etc; edit those only if you administer the machine and understand how your distribution builds login and secure paths.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A shell can also cache a failed lookup. Bash and many POSIX-like shells can clear that cache with:

hash -r

Zsh users can run:

rehash

Then repeat command -v ifconfig. When invoking a command through sudo, remember that sudo may use a restricted secure_path instead of your interactive PATH. Calling the full path, such as sudo /sbin/ifconfig, distinguishes that policy issue from a missing executable.

Use iproute2 instead of restoring the legacy command

Installing net-tools is useful when an old script, runbook or tutorial explicitly requires ifconfig. For new instructions, Debian’s reference recommends the iproute2 programs for low-level network configuration. The ip command is commonly already installed, so you may not need any package change for read-only inspection.

Traditional net-tools task iproute2 command What it shows or changes
ifconfig or ifconfig -a ip addr or ip -br addr Addresses; the -br form is compact and easier to scan.
Show one interface ip addr show dev INTERFACE Addresses assigned to the named interface.
Link state and hardware details ip link Link flags, state and link-layer information.
Packet counters ip -s link Per-link statistics.
Bring an interface up or down sudo ip link set dev INTERFACE up
sudo ip link set dev INTERFACE down
Changes the runtime link state; replacing INTERFACE is required.
Add an address sudo ip addr add ADDRESS/PREFIX dev INTERFACE Adds the specified address to the interface.
route -n ip route Routing table.
arp -n ip neigh Neighbor (ARP/NDP) cache.

The Ubuntu ifconfig manual specifically recommends ip link from iproute2 for link-layer information, including the hardware address. Read-only commands normally work as an ordinary user; commands that change links or addresses require sudo or equivalent administrative privileges.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose between compatibility and migration

Situation Best choice Reason
You must run an unchanged legacy script Install net-tools and correct PATH if needed. The script already expects ifconfig syntax and output.
You only need to inspect addresses or link state Use ip -br addr, ip addr or ip link. No legacy package is required when ip is present.
You are writing new configuration or automation Use ip and its subcommands. The iproute2 interface is the distribution-recommended low-level tool and is designed for current features such as multiple addresses and network namespaces.
A tutorial gives only ifconfig examples Translate the specific operation using the table above. You avoid adding a deprecated tool solely to follow an old example.

Installing net-tools and using ip are not mutually exclusive. You can keep the package for compatibility while adopting iproute2 for new commands.

Troubleshoot the errors that remain

“sudo: ifconfig: command not found” but the full path works

This indicates a difference between your user PATH and sudo’s secure path. Run command -v ifconfig, then invoke the printed absolute path with sudo, or have the system administrator correct the approved secure path. Do not blindly copy a user-controlled path into privileged configuration.

The package manager says net-tools is already installed

Check both /sbin/ifconfig and /usr/sbin/ifconfig directly. If one exists, repair the shell path and clear its command hash. If neither exists, verify that the package installation completed successfully and that you are operating in the same root filesystem or container where the package was installed.

Installation fails because repositories are unavailable

That is a package-manager or repository connectivity problem, not an ifconfig syntax problem. Resolve the repository error shown by apt, dnf, pacman, apk or zypper, then rerun the distribution-specific install command. If you only need interface information while the repository is unavailable, try ip -br addr and ip link first.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The command runs but shows no interface you expected

Use ifconfig -a or ip link to include interfaces that are down. In a container, virtual machine or network namespace, you see the interfaces belonging to that environment, not necessarily those on the host. Confirm that you are troubleshooting the intended shell, namespace and filesystem.

A script breaks after switching to ip

ifconfig and ip do not have interchangeable output formats. Update the script to parse the chosen command deliberately, or keep net-tools for that legacy script and migrate it separately. Test address ordering, interface names and failure handling rather than replacing the executable name only.

Changes disappear after reboot

The commands shown here inspect or modify the kernel’s current networking state. Persistent configuration is managed by the network system used by your distribution; save the desired setting there rather than assuming a one-time ifconfig or ip command becomes a boot configuration.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

A minimal decision procedure

  1. Run command -v ifconfig and type -a ifconfig.
  2. Try /sbin/ifconfig and /usr/sbin/ifconfig directly.
  3. If a full path works, add the correct directory to PATH, clear the shell hash, and verify with ifconfig -a.
  4. If neither path exists, identify the distribution with cat /etc/os-release and install net-tools using the matching command.
  5. For new inspection or configuration, prefer ip -br addr, ip addr, ip link, ip route and ip neigh.

Or skip the browser setup

If you also need a reliable screenshot of a web page while documenting a network issue, ScreenshotNeo returns a PNG, JPEG, WebP or PDF from one request. It accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and each response reports the result with X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the API examples in the ScreenshotNeo documentation with your own access key:

cURL

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

The Free plan includes 1,000 screenshots each month with no card. Paid plans start at $5 for 3,000 screenshots; every feature is included on every plan. Create a free ScreenshotNeo account.

Frequently Asked Questions

Does installing net-tools replace iproute2?

No. It adds the traditional utilities; the existing iproute2 commands remain available and can be used alongside them.

Why does ifconfig work in one terminal but not another?

Different login, shell, container or sudo environments can construct different PATH values. Compare the output of command -v ifconfig and the PATH variable in each environment.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can I diagnose networking without root access?

Most inspection commands, including ip -br addr, ip addr, ip link, ip route and ip neigh, can be run without changing system state. Operations that alter links or addresses require administrative privileges.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.