Manually configure the IP address of linux (centos), DNS, gateway

  
 

The NIC IP address of linux is stored in the file. This configuration file is in /etc/sysconfig/network-scripts and the names are ifcfg-eth0, ifcfg-eth1…. If you have a network card, only ifcfg -eth0 A file, if you have two or more NICs, there will be files such as ifcfg-eth1, ifcfg-eth2 and so on. File structure: DEVICE=eth0 //Indicates the device name ONBOOT=yes //Whether to start the application BOOTPROTO=static //Startup type static (default dhcp)IPADDR=192.168.0.77 //IP address NETMASK=255.255.255.0 //Subnet mask Code GATEWAY=192.168.0.1 //Save the gateway, exit vi /etc/resolv.conf and add DNS: nameserver 8.8.8.8 to save and exit. Restart the network card: service network restart

Copyright © Windows knowledge All Rights Reserved