Configure network CentOS7 (static ip, gw, ns)

network_centosInput data: IP 195.258.1.12; mask 255.255.255.192; GW 195.258.1.1; NS 8.8.8.8 and 8.8.8.4; interface ens32; hostname web-1.

#vi /etc/sysconfig/network-scripts/ifcfg-ens32


Red color is what I changed

TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=ens32
UUID=f56d3c65-02cf-46de-accf-bf387115058d
DEVICE=ens32
ONBOOT=yes
IPADDR=195.258.1.12
NETMASK=255.255.255.192
#vi /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
#vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=web-1
GATEWAY=195.258.1.1
#service network restart

or

#reboot

 

 

Leave a comment