ifconfig

In Linux, ifconfig is a command-line utility used for configuring and managing network interfacesIt allows you to view interface configurations, enable/disable interfaces, assign IP addresses, and more. While commonly used, ifconfig is now often deprecated in favor of the ip command, which offers more features and flexibility. 





Here's a summary of key ifconfig functions:

  • Displaying Interface Information:
    Running ifconfig without any arguments displays information about all active network interfaces, including their IP addresses, netmasks, and other details. 
  • Enabling/Disabling Interfaces:
    You can enable or disable a network interface using ifconfig interface up or ifconfig interface down, respectively. 
  • Assigning IP Addresses:
    You can assign an IP address to an interface using ifconfig interface inet [ip_address]. 
  • Setting Subnet Masks:
    You can configure the netmask for an interface using ifconfig interface netmask [subnet_mask]. 
  • Troubleshooting:
    ifconfig can help diagnose network issues by providing insights into interface status and configuration. 
Example Usage:
  • ifconfig: Displays all active interface configurations.
  • ifconfig eth0 up: Enables the interface named eth0.
  • ifconfig eth0 down: Disables the interface named eth0.
  • ifconfig eth0 192.168.1.10 netmask 255.255.255.0: Assigns the IP address 192.168.1.10 and netmask 255.255.255.0 to the interface eth0.