Home > Article > Operation and Maintenance > How to set the network card IP address under Linux
Method 1: Use the ifconfig command to configure the IP address of the network card
This command is usually used for temporary testing. After the computer is started, the IP The configuration of the address will be automatically invalidated.
The specific usage is as follows:
Ipconfig ethx ipadd netmask x.x.x.x
The x in ethx represents the fastest Ethernet card. The default first block is 0.ipadd represents the ip address and x.x.x..x is the subnet mask.
For example: the IP address configured for the network card eth0 is 192.168.1.1 and the subnet mask is 255.255.255.0.
As shown below:
Note: The IP address configured by this method will become invalid after the computer is restarted!
Online learning video sharing: linux video tutorial
Method 2: Use neat command
Neat command= Configure the ip address under the redhat-config-network graph
Double-click the red line under the graph
Double-click the underlined part and the following picture will appear: Configure relevant information as required
Double-click ok to complete the configuration. After configuration, restart the service and check the configured ip address
Method 3: Use the netconfig command
will appear after entering netconfig As shown in the picture below, click the yes button
to make relevant configurations and then exit with ok
Note: The IP address configured by this method is still valid after the computer is restarted!
Recommended related articles and tutorials: linux tutorial
The above is the detailed content of How to set the network card IP address under Linux. For more information, please follow other related articles on the PHP Chinese website!