in ODOC

ODOC: ifconfig

ifconfig – CONFIGure a `network’ InterFace

Summary :

ifconfig is used to display/configure the kernel-resident network interfaces. It is used at boot time to set up interfaces.

Example:

$ ifconfig — Show info abt the active network interfaces like IP Address, MAC address, Subnet mask, and status.

$ ifconfig -a — Show the status of active and inactive interfaces.

# ifconfig eth0 down — Deactivate/Shutdown the eth0 interface.

# ifconfig eth0 up — Activate the eth0 interface.

# ifconfig eth0 192.168.1.100 netmask 255.255.255.0 up — Activate an interface with specific IP address.

# ifconfig eth0:0 192.168.1.101 netmask 255.255.255.0 broadcast 192.168.1.255

# ifconfig eth0:1 192.168.1.102 netmask 255.255.255.0 — Creating alias for eth0, ie Assign more than one IP address to eth0.

# ifconfig eth0 arp — Enable the use of the ARP protocol on eth0.

# ifconfig eth0 -arp — Disable the use of the ARP protocol on eth0.

# ifconfig eth0 promisc — Enable the promiscuous mode on eth0.

# ifconfig eth0 hw ether 09:08:07:06:05:04 — Change eth0 MAC address.

# ifconfig eth0 mtu 1412 — Change Max Transfer Unit of eth0.

NOTE:

  • Deactivate the interface before changing the IP/MAC.
  • Note down the original MAC, Otherwise Reboot needed to get the original MAC Address.
  • Some command sequence needs super user permission.

Read : man ifconfig

ifconfig, network, odoc, linux, gnu/linux