
With the ifconfig command, you can assign an IP address and netmask to a network interface. The output will look something like this: eth0 Link encap:Ethernet HWaddr 4c:bb:58:9c:f5:55Īssign an IP address and Netmask to a Network Interface # To display the configuration information of any specific network interface, write the interface name after the command: ifconfig eth0 TX packets:59727 errors:0 dropped:0 overruns:0 carrier:0 RX packets:84110 errors:0 dropped:0 overruns:0 frame:0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 TX packets:4198 errors:0 dropped:0 overruns:0 carrier:0 RX packets:4198 errors:0 dropped:0 overruns:0 frame:0

TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 The output includes information about all active and inactive network interfaces: docker0 Link encap:Ethernet HWaddr 56:84:7a:fe:97:99 When invoked without any options, ifconfig displays the configuration information of all network interfaces and associated ip address: ifconfig -a Display Information of Network Interfaces # Only root or users with sudo privileges can configure network interfaces. To make the changes permanent, you need to edit the distro-specific configuration files or add the commands to a startup script. After a system restart, all changes are lost.



The configurations set with the ifconfig command are not persistent. address - is the IP address that you want to assign.interface - is the name of the network interface.
