Centos two ways to modify IP

nmtui command to bring up the Modify window: nmtui

   

Restart card: /etc/init.d/network restart

 

Or: Service Network restart

 

 

Second way:

Network Configuration File Directory

First, make sure the root operate user. Enter the network profile network-scripts directory.

cd /etc/sysconfig/network-scripts/

 

We find the need to modify the configuration file

Use the ls command to list files in that directory. Where "ifcfg-ens33" file, as we need to modify the network configuration file.

 

Modify the configuration file

Use vim command ( vi commands can also be) , the file configuration,

We need to modify BOOTPROTO = "static" that is, dhcp changed to static , modify ONBOOT = "yes" means that the card is set to turn on, while adding in the text below.

= 192.168.0.230 IPADDR # static IP

= 192.168.0.1 GATEWAY # default gateway

= 255.255.255.0 NETMASK # Subnet Mask

= 192.168.0.1 the DNS1 #DNS configuration

= 8.8.8.8 DNS2 # Google address

 

The ESC: + WQ , save and exit!

Guess you like

Origin www.cnblogs.com/kofsony/p/11540384.html