Linux ifconfig Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux ifconfig Guide
Complete beginner-friendly guide to ifconfig on Linux, covering Arch Linux, CachyOS, and other distributions including network interface configuration, IP address management, and network setup.
Table of Contents
- Understanding ifconfig
- ifconfig Installation
- ifconfig Basics
- Interface Configuration
- Troubleshooting
Understanding ifconfig
What is ifconfig?
ifconfig configures network interfaces.
Uses:
- Configure interfaces: Set up network interfaces
- View interfaces: Show interface information
- IP addresses: Set IP addresses
- Network setup: Configure network
Note: Modern alternative is ip command.
ifconfig Installation
Install ifconfig
Arch/CachyOS:
# Install net-tools
sudo pacman -S net-tools
Debian/Ubuntu:
sudo apt install net-tools
Fedora:
sudo dnf install net-tools
ifconfig Basics
View Interfaces
Basic usage:
# View all interfaces
ifconfig
# Shows all network interfaces
Specific Interface
Interface info:
# Specific interface
ifconfig eth0
# Shows interface information
Interface Configuration
Set IP Address
Configure IP:
# Set IP address
sudo ifconfig eth0 192.168.1.100
# Sets IP address
Set Netmask
Configure netmask:
# Set IP and netmask
sudo ifconfig eth0 192.168.1.100 netmask 255.255.255.0
# Sets IP and subnet mask
Troubleshooting
ifconfig Not Found
Check installation:
# Check ifconfig
which ifconfig
# Install if missing
sudo pacman -S net-tools
Summary
This guide covered ifconfig usage, interface configuration, and network setup for Arch Linux, CachyOS, and other distributions.
Next Steps
- ip Guide - Modern network tool
- Networking - Network setup
- nmcli Guide - NetworkManager CLI
- ifconfig Documentation:
man ifconfig
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.