How can I bring up a non-boot (ONBOOT=no) network interface with iproute2?
In RHEL 7, you'll have to use nmcli
command for permanent change. nmcli
command uses /etc/sysconfig/network-scripts/ifcfg-con_name
file first, also when you modify connection properties with nmcli
it will write to ifcfg-con_name
file. So, to automatically start connection, you need to use following:
nmcli con mod enp0s3 connection.autoconnect yes
It will change ONBOOT
property to yes
.
In order, to load newly changed configuration file, you need to use (otherwise it will load during next boot):
nmcli con down enp0s3
nmcli con up enp0s3
Good luck!
ifup enp0s3
should bring up the interface and configure it.
You might want to review the Network Interfaces chapter of the RHEL manual. §10.3. “Interface Control Scripts” mentions using ifup
.
ifconfig enp0s3 up
should not load any configuration from ifcfg-enp0s3
, by the way. See e.g., What is the difference between 'ifconfig up eth0' and 'ifup eth0'? on the RedHat Knowledge Base.