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
orsudo 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 viaroute -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.1Linux/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
andip 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
- Problem: John can’t reach the internet.
- Check IP assignment:
Windows:ipconfig
Linux:ifconfig
orip addr
- If you see 169.254.x.x – No DHCP response (APIPA). Check cables, DHCP server.
- Check gateway: Must be in same subnet as IP. Missing gateway = no external connectivity.
- Check interface status: Should be "up" or "connected".