[1] log on to CentOS system as a root user [2] Open a terminal [3] and enter the setup command. The configuration window is displayed, select "Network configuration" to configure [root @ localhost ~] # Setup [4] cancel User DHCP, enter the IP address to be configured, click OK, and Save the configuration. [5] using the command line method for network configuration (which is actually simpler) editing the configuration file
[Root @ localhost ~] # Vi/etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE = eth0
BOOTPROTO = none
HWADDR = 00: 0c: 29: 45: 0c: 2b
NM_CONTROLLED = yes
ONBOOT = yes
TYPE = Ethernet
UUID = "1115b32b-3afe-40ac-a036-542c34f000065"
IPADDR = 192.168.49.56
NETMASK = 255.255.255.0
GATEWAY = 192.168.49.2
DNS1 = 192.168.49.2
IPV6INIT = no
USERCTL = no restart the network service
[Root @ localhost ~] # Service network restartShutting down interface eth0: Device state: 3 (disconnected)
[OK]
Shutting down loopback interface: [OK]
Bringing up loopback interface: [OK]
Bringing up interface eth0: Active connection state: activated
Active connection path:/org/freedesktop/NetworkManager/ActiveConnection/3 [OK]