First, Introduction
Ifconfig is a tool that Linux systems use to obtain and modify network interface configuration information.
Note: The NIC information configured with the Ifconfig command does not exist after the machine restarts after the network card restarts. In order to keep the above configuration information in the computer forever, it is necessary to modify the network card configuration file.
Second, the application example:
Example 1: Displaying network device information (active state)
Ifconfig
Example 2: Start and close the specified NIC
ifconfig eth0 up ifconfig eth0 down #关闭网卡eth0
Example 3: Configuring and removing IPV6 addresses for network cards
ifconfig eth0 add 33ffe:3240:1005::2/ #为网卡eth0配置IPv6地址 ifconfig eth0 del 33ffe:3240:+:1005::2/ # Remove IPV6 address for Nic Eth0
Example 4: Modifying MAC Addresses
ifconfig xx: AA:BB:CC:DD:EE
Example 5: Configuring IP Addresses
ifconfig 192.168. 120.56 ifconfig 192.168. 120.56 255.255. 255.0
ifconfig 192.168. 120.56 255.255. 255.0 192.168. 120.255
Example 6: Enabling and shutting down the ARP protocol
ifconfig ARP protocol for eth0 ARP #开启网卡eth0;ifconfig eth0-arp #关闭网卡eth0 ARP protocol;
Example 7: Setting the Maximum transmission unit
ifconfig the
Example 8: Turn on the eth0 Nic's blending mode
ifconfig Eth0 Promisc
Linux ifconfig Commands