Ifconfig Tools
Ifconfig common usage
- Ifconfig: View the host activation status of the network interface situation; in the output: Lo is the return bad address of the host, Eth0 represents the first Nic, where HWaddr represents the physical address (MAC address) of the network card, inet addr is used to represent the IP address of the network card, Bcast represents the broadcast Address, mask represents the mask address
- Ifconfig-a: View the status of all host (including non-active) network interfaces
- Ifconfig eth0: Viewing the status of a specific network interface
- Ifconfig eth0 down = ifup eth0: If the eth0 is active, terminate it. This command is equivalent to Ifdown eth0;
- Ifconfig eth0 up = Ifdown eth0: activates eth0; This command is equivalent to Ifup eth0
- Ifconfig eth0 192.168.1.99 broadcast 192.168.1.255 netmask 255.255.255.0: Configure the Eth0 IP address, broadcast address, and netmask;
- Ifconfig eth0 192.168.1.99 broadcast 192.168.1.255 netmask 255.255.255.0 up: Configure IP address, netmask, broadcast address while activating NIC Eth0
- Ifconfig eth1 HW ether 00:11:00:00:11:22: Sets the physical address (MAC address) of the network card. Where HW is followed by the network interface type, ether means Ethernet, but also support ax25, ARCnet, Netrom, etc., see Man ifconfig for details;
Configuration of network devices
/etc/sysconfig/network-scripts/ifcfg-xxxx, the xxxx here is Ens33
Assign IP Address tool
Ifconfig
Linux Network configuration