Whether you are installing a new standalone Linux OS or using VMware, Hyper-V, or Amazon EC2 to install Linux as a guest OS. When you you make a “minimal” Linux install, meaning, no GUI, only install the very basic packages just to get a functional command line. Networking will not be enabled by default. Many may find that very challenging because it is not as easy to just make few clicks with your mouse to configure your ethernet adapter. However, it is really not that difficult to get networking enabled.
First, after you log in as root, browse to “network-scripts” directory
Type the command ls to display the directory content
You will find a file called ifcfg-eth0, that is your primary network adapter configuration file. If you have more than one network adapter, you will see ifcfg-eth0, ifcfg-eth1, ifcfg-eth2, etc.
Use vi to edit ifcfg-eth0
note, if you know you only have one networking adapter, you can skip all the steps mentioned above and as root, type
Press the insert key on your keyboard to get in edit mode in vi. look for the option:
Change the value to yes, so it will look like this:
That should be it. Restart the network adapter or just restart the operating system. Once the OS is back, networking should be enabled.