1

I just installed CentOS minimal and now I am struggling to give my machine a fixed IP address. This is my ifcfg-ens32 file:

DEVICE="ens32"
TYPE="Ethernet"
BOOTPROTO=static
IP_ADDR="192.168.0.243"
NETMASK="255.255.252.0"
NM_CONTROLLED="no"
ONBOOT="yes"
NAME="System ens32"
GATEWAY="192.168.0.1"
HWADDR="00:0C:29:7B:28:24"

when I systemctl restart network.service, I do get to see it enables the interface, but when I run ip a, that interface does not have an IP address.

What am I doing wrong?

Bart Friederichs
  • 353
  • 1
  • 6
  • 23

2 Answers2

0

As Anton already said, replace IP_ADDR with IPADDR. Also, make sure NetworkManager is not working:

systemctl stop NetworkManager
systemctl disable NetworkManager
ps auxww | grep NetworkManager
kill <pid> # in case there's any process running

and then

systemctl restart network

sysfiend
  • 1,327
  • 1
  • 11
  • 24
0

Just write IPADDR instead of IP_ADDR in your config file