Linux View IP address command--ifconfig
Ifconfig command to view and change the address and parameters of a network interface
The code is as follows:
$ifconfig-A
lo0:flags=849 MTU 8232
inet 127.0.0.1 netmask ff000000
hme0:flags=863 MTU 1500
inet 211.101.149.11 netmask ffffff00 broadcast 211.101.149.255
Ether 8:0:20:a7:4d:21
The system displays the name of the network interface, the state of the interface (up or down),
Interface IP address and mask information
To change the IP address of a network interface:
The code is as follows:
#ifconfig HME0 Down
#ifconfig HME0 211.101.149.233 netmask 255.255.255.0 up
First, use the down command parameter to HME0 the service of the network interface, and then use Linux to view the IP ifconfig command to
Interface to assign a new IP address and mask and start the network interface service
You can also change the IP address of the machine by changing the value of the IP address in the file/etc/hosts and restarting the system.
The code is as follows:
/etc/hosts/: 211.101.149.11 SAMPDT
Define host name in/ETC/HOSTNAME.HME0 and IP address.
Changed the NIC/Added network card, the system does not automatically start the interface service, you need to manually create the network port services:
The code is as follows:
#ifconfig HME0 Plumb
Linux view IP can be used to create a network port service for interface Le0
Accordingly, you can stop the service and shut down the network with the ifconfig with the Unplumb parameter.
Netconfig used to set IP addresses