Centos system configuration static ip and network settings

1. Modify the host name

[root@centos ~]# vim /etc/sysconfig/network

 

NETWORKING=yes

NETWORKING_IPV6=no

HOSTNAME=localhost.localdomain

 

GATEWAY=192.168.17.2

 

2. Modify the network card

[root@centos ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0

 

DEVICE=eth0

BOOTPROT=static

IPADDR=192.168.17.128

GATEWAY=192.168.17.2

NETMASK=255.255.255.0

ONBOOT=yes

 

DNS1=192.168.17.2

 

3. Restart the network configuration

[root@centos ~]#service network restart

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326752418&siteId=291194637