ifconfig is a command-line utility for network interface management on CentOS systems. It provides functionality to query, configure, activate, and deactivate network interfaces.
Key Functions
- Display Interface Details: Show configuration and status for all or a specific network interface.
- Configure Network Parameters: Set IP address, netmask, broadcast address, and other interface properties.
- Control Enterface State: Bring interfaces up (activate) or down (deactivate).
Basic Usage for Viewing Information
To display information for all active network interfaces, execute the command without arguments.
ifconfig
To view details for a specific interface, include its name.
ifconfig eth0
Comparison with Windows ipconfig
CentOS's ifconfig and Windows's ipconfig serve similar primary functions.
| Task | CentOS (ifconfig) |
Windows (ipconfig) |
|---|---|---|
| Show basic config | ifconfig |
ipconfig |
| Show detailed config | ifconfig [interface] |
ipconfig /all |
Sample Output and Explanation
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fe80::a00:27ff:fe43:1510 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:43:15:10 txqueuelen 1000 (Ethernet)
RX packets 1256 bytes 1102345 (1.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 889 bytes 98765 (96.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens33: The name of the network interface.flags: Interface state flags (e.g., UP, RUNNING).inet: IPv4 address.netmask: IPv4 subnet mask.broadcast: IPv4 broadcast address.inet6: IPv6 address.ether: Hardware (MAC) address.RX/TX packets: Counters for received and transmitted packets.