ipconfig vs ifconfig – Viewing and Troubleshooting IP Configuration

What are ipconfig and ifconfig?

ipconfig: Command-line utility for Windows to display and manage IP network configuration.
ifconfig: Command-line tool for Linux/macOS to view and configure network interfaces.
Purpose: Both tools are used to view network settings, troubleshoot issues, and verify IP assignments.

Aspect ipconfig (Windows) ifconfig (Linux/macOS)
Platform Windows Linux / macOS
Function View/manage network settings, DHCP release/renew View/manage network interfaces (assign IPs, up/down, etc.)
Modern Alternative ip command (preferred on modern Linux)

Basic Commands and Usage

On Windows

  • View basic IP configuration:
    ipconfig
  • View all details:
    ipconfig /all
  • Release DHCP-assigned IP:
    ipconfig /release
  • Renew DHCP-assigned IP:
    ipconfig /renew

On Linux/macOS

  • View active interfaces:
    ifconfig
  • Show all interfaces (even down):
    ifconfig -a
  • Bring interface up/down:
    sudo ifconfig eth0 up or sudo ifconfig eth0 down
Modern Linux: Use ip addr (show IP addresses) and ip link (show interfaces).

Viewing IP Address Information

  • Both commands display IPv4 and IPv6 addresses, subnet mask/netmask, and MAC address.
  • Default gateway: Seen in ipconfig output, or via route -n/ip route in Linux.
Windows Example:
Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . :
   IPv4 Address. . . . . . . . . . . : 192.168.1.100
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1
      
Linux/macOS Example:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
      inet 192.168.1.100  netmask 255.255.255.0  broadcast 192.168.1.255
      inet6 fe80::1c3b:22ff:fe4b:a8e3  prefixlen 64  scopeid 0x20<link>
      ether 00:1c:42:4b:a8:e3  txqueuelen 1000  (Ethernet)
      

Viewing Network Interface Details

  • Interface Status: Up/down or connected/disconnected.
  • MAC Address: "Physical Address" (Windows), "ether" (Linux/macOS).
  • Additional Info: DNS servers, DHCP status, MTU, etc.

Additional Command Options

  • ipconfig /all: Full details (DHCP server, lease, DNS, MAC, etc.)
  • ifconfig -a: Show all interfaces, even those not up

Releasing and Renewing IP Addresses (Windows Only)

  • ipconfig /release: Releases DHCP IP (sets to 0.0.0.0)
  • ipconfig /renew: Requests new DHCP IP
Use Case: Resolving IP conflicts or refreshing a DHCP lease.

Differences Between ipconfig and ifconfig

Aspect ipconfig ifconfig
Output format Structured, clear adapter headings Block per interface, technical fields
Functionality View and manage IPs, DHCP only View, assign IP, bring up/down, more configuration
Modern replacement ip addr, ip link (Linux)

Common Use Cases

  • Troubleshoot network connectivity: Check if interface has valid IP, subnet, and gateway.
  • Verify DHCP assignment: Ensure IP is assigned by DHCP, not self-assigned (e.g., 169.254.x.x).
  • Check interface config: Validate MAC, MTU, operational status.

Limitations and Modern Alternatives

  • ifconfig is deprecated on new Linux; use ip addr and ip link instead.
  • ipconfig is still the standard on Windows.

Interpreting Output

  • IPv4/IPv6 Address: Unique address for the device.
  • Subnet Mask: Defines the network/host split.
  • Default Gateway: Router for external traffic.
  • MAC Address: Physical hardware address (Layer 2).
  • DHCP Enabled: Shows if address is automatic.

Exam Tips and Key Points

  • Know ipconfig (Windows) vs ifconfig/ip (Linux/macOS).
  • ipconfig /all provides maximum info on Windows.
  • On Linux, ip addr is preferred for modern exams/real-world.
  • APIPA addresses (169.254.x.x) = DHCP failure on Windows.
  • Subnet mask and gateway must match network design.
  • Use these tools first when troubleshooting network issues.

Sample Troubleshooting Scenario

  1. Problem: John can’t reach the internet.
  2. Check IP assignment:
    Windows: ipconfig
    Linux: ifconfig or ip addr
  3. If you see 169.254.x.x – No DHCP response (APIPA). Check cables, DHCP server.
  4. Check gateway: Must be in same subnet as IP. Missing gateway = no external connectivity.
  5. Check interface status: Should be "up" or "connected".

IP Configuration Commands Quiz

1. Which command is used on Windows to display current IP configuration?

Correct answer is A. "ipconfig" is the Windows command-line tool to view and manage IP configuration.

2. On Linux or macOS, which command shows active network interfaces and their IP addresses?

Correct answer is B. "ifconfig" is the traditional tool on Linux/macOS to view and configure network interfaces.

3. Which ipconfig option releases the DHCP-assigned IP address on Windows?

Correct answer is C. The "/release" option tells Windows to drop the current DHCP lease and release the IP address.

4. What command on Windows renews the DHCP-assigned IP address?

Correct answer is D. "ipconfig /renew" requests a new IP address from the DHCP server.

5. Which command shows all network interfaces, even those that are down, on Linux/macOS?

Correct answer is A. The "-a" option with ifconfig displays all interfaces, including inactive ones.

6. What is the modern preferred Linux command that often replaces ifconfig?

Correct answer is B. The "ip" command is the modern tool for managing network interfaces and addresses on Linux.

7. Which of the following IP addresses indicates a failure to obtain an IP from DHCP on Windows?

Correct answer is C. The 169.254.x.x range is Automatic Private IP Addressing (APIPA), indicating no DHCP server response.

8. In Windows ipconfig output, what term refers to the MAC address of the network adapter?

Correct answer is D. Windows ipconfig shows the MAC as "Physical Address."

9. What does the subnet mask define in an IP configuration?

Correct answer is B. Subnet mask divides the IP address into network and host parts.

10. Which command would you use on Linux to bring an interface down?

Correct answer is A. On Linux, "sudo ifconfig eth0 down" disables the interface eth0.

← Back to Home