Detailed explanation of the usage of network command ifconfig.

WBOY
Release: 2024-02-18 17:50:24
forward
1544 people have browsed it

Detailed explanation of the usage of network command ifconfig.

ifconfig is a commonly used network command used to display and configure network interface information. The following is a detailed explanation of the ifconfig command:

Command format:

ifconfig [网络接口] [选项]
Copy after login

Common options:

  • -a: Display detailed information for all network interfaces (including unenabled interfaces).
  • up: Enable the specified network interface.
  • down: Disable the specified network interface.
  • inet: Displays the IPv4 address.
  • inet6: Display IPv6 address.
  • netmask: Displays the subnet mask.
  • broadcast: displays the broadcast address.
  • hw
    ether: Displays the hardware address (MAC address).
  • promisc: Set the network interface to promiscuous mode.

Example usage:

  1. Display information about all network interfaces:

    ifconfig -a
    Copy after login
  2. Enable network interface:

    ifconfig eth0 up
    Copy after login
  3. Disable network interface:

    ifconfig eth0 down
    Copy after login
  4. Display the IPv4 address and subnet mask of the specified network interface:

    ifconfig eth0 inet
    Copy after login
  5. Display the IPv6 address and subnet mask of the specified network interface:

    ifconfig eth0 inet6
    Copy after login
  6. Display the broadcast address of the specified network interface:

    ifconfig eth0 broadcast
    Copy after login
  7. Display the hardware address (MAC address) of the specified network interface:

    ifconfig eth0 hw ether
    Copy after login
  8. Set the specified network interface to promiscuous mode:

    ifconfig eth0 promisc
    Copy after login

    The ifconfig command provides various information about the network interface, such as IP address, subnet mask, broadcast address, hardware address, etc. By becoming familiar with and using the ifconfig command, you can manage and adjust the configuration of network interfaces. Please note that ifconfig has been replaced by the ip command in some Linux distributions, but it is still one of the commonly used commands on many systems.

    The above is the detailed content of Detailed explanation of the usage of network command ifconfig.. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:mryunwei.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template