I have a CentOS 6.7 minimal distribution which I created in virtual box. As an afterthought, I added a secondary network interface in virtualbox, so I have an NAT interface, and a host-only local network. When I log into my virtual machine and run:
ip link show
Shows eth0 as UP and eth1 as DOWN. When I try:
ifup eth1
I get configuration for eth1 not found. When I look in /etc/sysconfig/network-scripts, I see an icfg-eth0 file, but no icfg-eth1 file.
I have a few questions:
- Should icfg-eth1 have been generated when I added the host-only local connection in virtualbox?
- If I have to create the icfg-eth* file myself, which tool should I use to generate it? Which package should I install to get it?
- Should I ever manually edit the contents of /etc/sysconfig/network-scripts?
Best Answer
No. Since you performed a minimal installation NetworkManager is not installed and so there's nothing on the system to detect new network interfaces and configure them for you.
ifcfg-eth0
was created for you since the interface existed during installation.You could just create it by hand:
ifcfg-eth0
file and name itifcfg-eth1
ifcfg-eth1
in a text editor (e.g.vi
)Alternatively you could install and use the System-Config-Network tool:
It is okay to do this, just make sure you're careful while doing so. Make copies of any files you are editing just in case you need to revert your changes. Also, ensure you have another way to access the system in case you completely break network access to it (e.g. console access).
It's a good idea to familiarise yourself with the structure and contents of that directory.