How to use Linux ifconfig command Ankit Chaubey, 15, June 202226, June 2022 ifconfig (interface configuration) is a network management tool. It is used to configure and view the status of the network interfaces in Linux operating systems. With ifconfig, you can assign IP addresses, enable or disable interfaces, manage ARP cache, routes, and more.TABLE OF CONTENTS1 How to install ifconfig1.1 Install ifconfig on Debian1.2 Install ifconfig on Centos2 Assign an IP address and Netmask to a Network Interface3 Enable and Disable a Network Interface4 Enable and Disable Promiscuous Mode5 Change MTU of a Network Interface6 Change the MAC address of a Network Interface6.1 About The Author6.1.1 Ankit Chaubey6.2 RelatedHow to install ifconfigThe ifconfig order is censured and supplanted with ip and may not be remembered for the more current Linux distributions.If you get an error message saying “ifconfig: command not found”, it means that the package that contains the command is not installed on your system.Install ifconfig on DebianRun the following command to install ifconfig:sudo apt install net-tools -yInstall ifconfig on CentosOn CentOS and other RHEL based Linux distros, type:ifconfig [-a] [-v] [-s] <interface> [[<AF>] <address>]interface – is the name of the network interface.address – is the IP address that you want to assign.The configurations set with the ifconfig command is not permanent. After a restart, all changes are lost. To make the changes permanent, you need to edit the distro-specific configuration files or add the commands to a startup script.Only root or users with sudo privileges can configure network interfaces.Assign an IP address and Netmask to a Network InterfaceUse the following syntax to assign the IP address and netmask:ifconfig [interface-name] [ip-address] netmask [subnet-mask] For example, to assign the IP address 192.168.0.10 and netmask 255.255.0.0 to the interface eth0, you would run:ifconfig eth0 192.168.0.10 netmask 255.255.0.0You can also assign a secondary IP address to a network interface using the interface aliasing:ifconfig eth0:0 192.168.0.11 netmask 255.255.0.0Enable and Disable a Network InterfaceSometimes, you may need to reset the network interface. In this case, the ifconfig command can be used to enable or disable a network interface.To disable an active network interface , enter the device name followed by the down flag:ifconfig eth0 downTo enable an inactive network interface, use the up flag:ifconfig eth0 upEnable and Disable Promiscuous ModePromiscuous allows a network interface to access and view all packets in a network. You can use the ifconfig command to enable and disable the promiscuous on a specific network device.To enable the promiscuous mode on a network interface, enter the promisc flag after the device name:ifconfig eth0 promiscTo disable the promiscuous mode, use the -promisc flagifconfig eth0 -promiscChange MTU of a Network InterfaceThe MTU “Maximum Transmission Unit” allows you to limit the size of packets that are transmitted on an interface.You can change the MTU value using the syntax:ifconfig [interface-name] mtu [mtu-value] For example, set the MTU value of a network interface eth0 to 500, run the following command:ifconfig eth0 mtu 500Change the MAC address of a Network InterfaceThe MAC “Media Access Control” is the physical address that uniquely identifies the devices on a network.To change the MAC address of a network interface, use the hw ether flag to set the new MAC address:ifconfig eth0 hw ether 00:00:2d:3a:2a:28About The Author Ankit Chaubey See author's postsRelated Linux Reveals Assign an IP address and Netmask to a Network InterfaceChange MTU of a Network InterfaceChange the MAC address of a Network InterfaceEnable and Disable a Network InterfaceEnable and Disable Promiscuous ModeHow to Install ifconfigInstall ifconfig on CentosInstall ifconfig on DebianLinuxWhat is Linux ifconfig Command
Reveals The Best Free APIs For Projects to Get You Started 15, March 202315, March 2023There are some free APIs for projects that you may include into your projects or MVPs for free, despite the fact that many of them are premium and charged for. The greatest free APIs that we are aware of are listed below. They provide valuable functionality either totally free or… Read More
How To 3 Way to Install Python on Ubuntu 26, April 202326, April 2023Python usually comes pre-installed in Ubuntu, but if it isn’t accessible on your Linux distribution for any reason, you can install Python in Ubuntu in a few steps. Python is required for developers to build various software and websites. Aside from that, a lot of Ubuntu’s software relies on Python…. Read More
Hacking The Best Penetration Testing Tools for Linux 16, March 202316, March 2023Penetration Testing is the process of identifying, exploiting and mitigating vulnerabilities in wireless networks. It is an important part of network security and often requires specialized tools to be used. Linux is a great platform for wireless penetration testing as it has a wide variety of tools available for this… Read More