Linux system network configuration and linux System Network Configuration
Linux Network Configuration
There are several methods to configure the Linux system network. Here we will introduce two common methods.
First, use the command ifconfig to configure. Use Ipconfig ethx x. x netmask x. x
The effect is as follows:
Generally, this configuration method is only used for testing, because after the machine is restarted, the configuration content will become invalid.
Method 2: vi/ect/sysconfig/network-scripts/ifcfg-ethx
This configuration method directly modifies the configuration file, and the configuration effect will always take effect.
Is the effect of the virtual machine configuration in this example. The specific parameters are not parsed:
Common Linux Network commands:
Modify DNS command:
# Vi/etc/resolv. conf
Nameserver 202 101.224.68
Nameserver 202.101.224.69
Long-term effectiveness:
Enable eth0: ifup eth0
Disable eth0: ifdown eth0
Temporary effect:
Enable NIC: ifconfig eth0 up
NIC: ifconfig eth0 down
Restart the server:
Service network restart or/etc/init. d/network restart
Configure the Host Name and Default Gateway:
Vi/etc/sysconfig/network
NETWORKING = yes whether to enable the System Network Function
HOSTNAME = centosmin