Linux – Where is the ifcfg file of a (Host-only) virtual network adapter on CentOS

centoslinuxnetworkingvirtual-machinesvmware-workstation

I'm using a CentOS virtual machine, i have already assigned two network adapters using the VMware Workstation but the Virtual Network Editor lets you change only the Subnet IP, the Subnet Mask and the MAC.

However, i also need to change the IPADDR, the BROADCAST, the DHCP_HOSTNAME, the ON_BOOT and the DEVICE variables on each network adapter.

I don't see any ifcfg file relevant to those two network adapters inside /etc/sysconfig/network-scripts. And i don't see those network adapters using the Network Administration Tool (system-config-network).

What is the most appropriate way to change those variables?

Best Answer

The interface configuration file under CentOS are named /etc/sysconfig/network-scripts/ifcfg-<ifname> where <ifname> is the interface name. For interface eth0, the file will be named ifcfg-eth0.

In case someone assign an extra network card or change the configuration of an already existing then make sure to restart the network with service network restart in terminal.