The Ifconfig command is primarily used to configure or display network devices, network Interface Controller network adapters, and networks. You can also specify a network interface address (IP address) using the Ifconfig command.
Grammar:
ifconfig [-A |-S |-v] [network device] [down | up |[ -]allmulit | [-]arp | [-]promisc] [Add < address;] [del < address;] [hw< network Device type > < hardware address;] [io_addr <i/o address;] [IRQ <IRQ address > ] [Media < network media type;] [Mem_start < memory address;] [metric < number;] [MTU < bytes;] [netmask < subnet mask;] [Tunnel < [[-]broadcast < address] [[-]pointtopoint < address;] [IP Address]
- -A: Displays full device information. (The active device is displayed by default)
- -S: Displays device brief information.
- -V: Displays detailed information.
- [Network Device]: the name of the network device. such as Eth0
- Down: Turns off the specified network device.
- Up: Starts the specified network device.
- Allmulit: Determines whether the network device will receive multicast packets. The minus sign indicates that it is received, and no sign is received.
- ARP: shuts down or initiates ARP for the specified network device to obtain the hardware address. The symbol indicates off and no sign is started.
- Promisc: Turns off or starts the promiscuous mode of the specified network device (receives all network packets). The minus sign is off, and no minus sign indicates start.
- Add < address >: Sets the IP address of the network device IPV6.
- Del < address >: Remove the IP address of the network device IPV6.
- HW < network Device type > < hardware address >: Sets the type and hardware address of the network device. The supported types are ether, ax25, apcnet, and Netrom.
- Io_add <I/O Address >: Sets the I/O address of the network device.
- IRQ <IRQ address >: Set up interrupt requests for network devices.
- Media < network Media type >: Sets the media type of the network device.
- Mem_start < memory address >: Sets the start address that the network device occupies in memory.
- Metric < number >: Specifies the number to add when calculating the number of times a packet is delivered.
- MTU < bytes >: Sets the maximum transmission unit of a network device in bytes.
- netmask < Subnet mask >: Sets the subnet mask for the network device.
- Tunnel < address >: Establish a Tunnel communication address between IPV4 and IPV6.
- Broadcast < address >: Sends the packet to the specified address as a broadcast. The minus sign is off, and no minus sign indicates start.
- -pointtopoint < address >: Establish a direct connection to a network device with the specified address, which has a privacy feature.
- [IP Address]: Specifies the IP address of the network device.
is the output of the Ifconfig command. Specific indications:
- Eth0: Represents the first Ethernet card of the current system. If you have more than one NIC, the other network card numbers will eth1,eth2 and so on.
- Lo: local loopback network card.
- Hwaddr:mac address.
- inet Addr:ip address. (IPV4 Standard)
- Bcast: Broadcast address.
- Mask: Subnet mask.
- Inet6 Addr:ip address. (IPV6 Standard)
- MTU: The maximum transmission unit for the device.
- Metric: The measure value of the device.
- RX: the received packet.
- TX: the transmitted packet.
- Interrupt: Interrupt number.
- Base Address: Port number.
Example:
$ ifconfig eth0 192.168.1.105 netmask 255.255.255.0 broadcast 192.168.1.255 # # set eth0 network interface IP is 192.168.1.105. The subnet mask is 255.255.255.0 broadcast address is 192.168.1.255$ ifconfig ehto down## disable eth0 network interface $ ifconfig etho up## enable Eth0 network interface $ ifconfig eth0 Add addr fe80::20c:29ff:fedb:ace6/64## adds a IPv6 address
The Ifconfig of Linux commands