3

I'm writing some documentation on configuring the network interfaces for a new CentOS 7 server. The specific section walks through setting the interface to a static IP address.

The steps thus far are:

# nmcli con mod eno16777984 ipv4.address 192.168.1.31/24
# nmcli con mod eno16777984 ipv4.gateway 192.168.1.1
# nmcli con mod eno16777984 ipv4.method manual
# nmcli con mod eno16777984 ipv4.dns 8.8.8.8
# nmcli con reload eno16777984

I notice though, that the above steps don't set the interfaces IP to the static IP set above (via ip addr show), when I restart the network service via systemctl, it breaks the networking config (my connection dies). I log back in via the terminal and add NM_CONTROLLED=yes to the `/etc/sysconfig/network-scripts/ifcfg-eno16777984, and restart networking again, and it works just fine.

So basically, I just want to know if it's possible to set the NM_CONTROLLED value to yes, using nmcli itself?

I know I can just echo 'NM_CONTROLLED=yes' > /etc/sysconfig/network-scripts/ifcfg-eno16777984, but I was trying to script this out via nmcli itself.

I couldn't find much on this, so it may not be possible, but I thought id at least find out for sure

1 Answer 1

1

No, it's not possible to change NM_CONTROLLED via nmcli, because that property is not a regular property of NM's connection. It's a special setting to tell NM and ibiscripts whether the device is managed by NM or not.

Side note: nmcli con reload eno16777984 is wrong. First, after nmcli con mod you don't need to reload any connections. Second, reload doesn't accept an argument as it reloads all connections. Also, when using NM, you would normally not restart network service, but nmcli con up ....

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .