Related
Display Network Statistics
Show network connections, routing tables, interface statistics, and listening ports.
Test Network Connectivity
Test the reachability of a network host and measure round-trip time for packets sent to it.
Secure Shell Remote Login
Securely connect to remote systems using encrypted communication.
Command
ifconfigExplanation
`ifconfig` (interface configuration) is part of the net-tools package and allows users to configure network interfaces. It can bring interfaces up or down, assign IP addresses, and view current network settings. Modern systems often use `ip` commands instead of `ifconfig` for advanced functionality.
Common Use Cases
- •Check network interfaces and IP addresses
- •Assign temporary IP configurations
- •Enable or disable interfaces manually
Best Practices
- ✓Use `ip a` as a modern alternative for listing interfaces
- ✓Avoid persistent configurations with `ifconfig`; use network manager instead
Common Mistakes to Avoid
- ⚠Forgetting `sudo` when modifying interfaces
- ⚠Using `ifconfig` on modern systems without installing net-tools
Troubleshooting
Problem: Command not found
Solution: Install net-tools using `sudo apt install net-tools`.
Problem: Interface not showing
Solution: Use `sudo ifconfig -a` to display all interfaces, including inactive ones.
Examples
List all network interfaces and their details
ifconfigEnable a network interface
ifconfig eth0 upAssign IP address to interface
ifconfig eth0 192.168.1.10 netmask 255.255.255.0