ADVERTISEMENT

Linux Commands ❯ ifconfig

ifconfig

Configure a Network Interface
syntax:

ifconfig [-v] [-a] [-s] [interface]
ifconfig [-v] interface [aftype] options | address ...
  • ifconfig
    Displays the status of the currently active network interfaces
  • ifconfig eth0
    Displays the status of network interface eth0
  • ifconfig eth0 up
    activate the network interface eth0
  • ifconfig eth0 down
    deactivate the network interface eth0
  • ifconfig eth0 192.168.0.100
    Configure the network interface eth0 to use the static IP address 192.168.0.100.
  • ifconfig eth0 netmask 255.255.255.0
    Configure the network interface eth0 to use the network mask address 255.255.255.0
  • ifconfig eth0 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255
    Configure the network interface eth0 to use the static IP address 192.168.0.100, 255.255.255.0 as network mask and 192.168.1.255 as broadcast address
  • ifconfig eth0 mtu 1500
    set the Maximum Transfer Unit(MTU) to 1500 of network interface eth0
  • ifconfig eth0 hw ether 08:00:27:29:17:bb
    change the MAC( hardware address ) of the network interface eth0
  • ifconfig -a
    Displays the status of all the active and inactive network interfaces