ifconfig CommandifconfigThe ifconfig command is used to configure and display network interface parameters for a Linux system. It allows users to view network interface information and manage network configurations.
ifconfig [INTERFACE] [OPTIONS]
ifconfiginterfaceSpecify the network interface to configure or display. For example, eth0, wlan0, etc.
ifconfig eth0
upActivate the specified interface:
ifconfig eth0 up
downDeactivate the specified interface:
ifconfig eth0 down
inet addressAssign an IP address to the specified interface:
ifconfig eth0 inet 192.168.1.100
netmask maskAssign a netmask to the specified interface:
ifconfig eth0 netmask 255.255.255.0
broadcast addressAssign a broadcast address to the specified interface:
ifconfig eth0 broadcast 192.168.1.255
hw ether addressChange the hardware (MAC) address of the interface:
ifconfig eth0 hw ether 00:11:22:33:44:55
mtu sizeSet the Maximum Transmission Unit (MTU) size:
ifconfig eth0 mtu 1400
-aShow all interfaces, including those that are down:
ifconfig -a
-sDisplay a short summary of the network interfaces:
ifconfig -s
-hDisplay help information for the command:
ifconfig -h
ifconfig Commandifconfig
This command displays all active network interfaces and their configurations.
ifconfig eth0 up
This command activates the eth0 interface.
ifconfig eth0 down
This command deactivates the eth0 interface.
ifconfig eth0 inet 192.168.1.100 netmask 255.255.255.0
This command assigns the IP address 192.168.1.100 to the eth0 interface with the specified netmask.
The output of the ifconfig command typically includes the following information:
eth0, wlan0).| Option | Description |
|---|---|
interface |
Specify the network interface to configure or display. |
up |
Activate the specified interface. |
down |
Deactivate the specified interface. |
inet address |
Assign an IP address to the specified interface. |
netmask mask |
Assign a netmask to the specified interface. |
broadcast address |
Assign a broadcast address to the specified interface. |
hw ether address |
Change the hardware (MAC) address of the interface. |
mtu size |
Set the Maximum Transmission Unit (MTU) size. |
-a |
Show all interfaces, including those that are down. |
-s |
Display a short summary of the network interfaces. |
-h |
Display help information for the command. |