ifconfig is a network administration tool used to configure, control, and view network interfaces on a system. It displays the network interface configuration and network status information, such as IP addresses, netmasks, broadcast addresses, MAC addresses, and other network statistics. The ifconfig command is useful for troubleshooting network connectivity issues, configuring network interfaces, and monitoring network performance.
Basic Syntax
ifconfig [interface] [options]
Here, interface specifies the network interface name, such as eth0, eth1, lo, etc. If no interface is specified, ifconfig displays the configuration and status information for all active network interfaces.
Commonly Used Options
-
up: This activates the specified network interface. -
down: This deactivates the specified network interface. -
inet addr: This sets the IP address of the network interface. -
netmask mask: This sets the netmask of the network interface. -
broadcast addr: This sets the broadcast address of the network interface. -
hw ether address: This sets the MAC address of the network interface. -
promisc: This sets the network interface to promiscuous mode. -
mtu size: This sets the maximum transmission unit (MTU) size of the network interface.
Useful Examples
-
ifconfig: This displays the configuration and status information for all active network interfaces. -
ifconfig eth0: This displays the configuration and status information for the eth0 network interface. -
ifconfig eth0 up: This activates the eth0 network interface. -
ifconfig eth0 down: This deactivates the eth0 network interface. -
ifconfig eth0 inet 192.168.1.100 netmask 255.255.255.0: This sets the IP address and netmask of the eth0 network interface. -
ifconfig eth0 broadcast 192.168.1.255: This sets the broadcast address of the eth0 network interface. -
ifconfig eth0 hw ether 00:11:22:33:44:55: This sets the MAC address of the eth0 network interface. -
ifconfig eth0 promisc: This sets the eth0 network interface to promiscuous mode. -
ifconfig eth0 mtu 1500: This sets the maximum transmission unit (MTU) size of the eth0 network interface to 1500 bytes.
Leave a Reply