2.3Day
Ifconfig command
Introduction:
ifconfig stands for interface configuration. It is oneof the most used Linux commands. The ifconfig command is used for:
displaying current network configuration information
setting up an IP address, subnet mask, broadcast address and hardware address to a network interface
enabling or disabling network interfaces
DisplayingNetwork Configuration
ifconfig command inits simplest form will display allthe active interface details. Basic information displayed upon using ifconfig is:
Todisplay network settings of a specific interface use the command as:
ifconfig <
interf
aceName>
Enabling or Disabling the Interface
To disable the interface we use the command:
ifconfig <interfaceName> down
To enable a network interface we use the command:
ifcon
fig <interfaceName> up
Setting up IP Address, Subnet Mask and Broadcast Address
To assign an IP Address to network interface use the command:
ifconfig <interfaceName> <IP Address>
To assign subnet mask to network interface use the command:
ifconfig <interfaceName> netmask <Subnet Mask>
To assign a broadcast address to network interface use the command:
ifconfig <interfaceName> broadcast <Broadcast Address>
To assign an IP address, netmask and broadcast address all at once use the command:
ifconfig <interfaceName> <IP Address> netmask <Subnet Mask> broadcast <Broadcast Address>
Setting up MAC Address to an Interface
To change the MAC address of an Interface use the command:
ifconfig <interfaceName> hw ether <MAC address>
Finally in order to get more information about ifconfig command use commands like man ifconfig
or ifconfig --help
at the terminal.