Ubuntu ifconfig Command: View/Configure Network Interfaces
In the Ubuntu system, `ifconfig` is a classic tool for viewing and configuring network interfaces, widely used in daily network operations and troubleshooting. Network interfaces include wired network cards (e.g., `eth0`/`ens33`), wireless network cards (e.g., `wlan0`), and the local loopback interface (`lo`). Each interface has a MAC address, an IP address, and its status is either enabled (`UP`) or disabled (`DOWN`). **Viewing Interface Information**: - Executing `ifconfig` without parameters displays enabled interfaces, with focus on IP address, MAC address, packet counts, and the `UP` status. - The `-a` option shows all interfaces (including disabled ones). - The `-s` option outputs a concise summary of metrics (e.g., MTU, speed). **Temporary Configuration**: Requires `sudo` privileges. You can temporarily set an IP address (e.g., `ifconfig ens33 192.168.1.200 netmask 255.255.255.0`), and use `up`/`down` to enable/disable the interface (this configuration is lost after a reboot). **Note**: Ubuntu 20.04+ requires installing `net-tools` (which includes `ifconfig`) first. Temporary configuration is suitable for testing purposes.
Read More