The ifconfig command stands for interface configuration which is a utility in Unix/Linux operating system. It shows the present network configuration information, setting up an IP address, netmask or broadcast address to a network interface, creating an alias for the network interface, setting up hardware address and enable or disable network interfaces.

Synopsis:

ifconfig[interface]

ifconfig interface [aftype] option|address

Uses of “ifconfig” command

The “ifconfig” command is used to display all the network settings. The

ifconfig -acommand displays the information about all network interfaces.

ifconfig interface name command views the network setting of a specific network interface.

ifconfig interface name up command enables the network interface.

ifconfig interface down command disables a network interface.

ifconfig interface name IP address command assigns the IP address for given interface.

ifconfig interface name broadcast IP address command assigns a broadcast to the network interface.

ifconfig interface name IP address netmask address broadcast address command assigns the IP, netmask, and broadcast to a network interface.

ifconfig interface name mtu value command changes the maximum transmission unit(MTU).

ifconfig interface name promisc command enables the promiscuous mode.

ifconfig interface name - promisc command disables the promiscuous mode.

To add alias network interface of eth0, use the following command. Please note that alias network address in the same subnet mask. For example, if your eth0 network IP address is 10.224.210.201, then alias IP address must be 10.224.210.201

Example:

ifconfig eth0:0 10.224.210.201

To remove the alias to network interface, use the following command

ifconfig eth0:0 down

 

Tagged in:

,