It’s been quite a while since my last post on the blog, but now I’m back with a post regarding networking on CentOS. I did some work with CentOS in the past few months and I thought that’s good to have the information on the blog as well. Have to mention that I’m not an expert on Linux.
First of all, if you install CentOS on Hyper-V and you make it gen 2 VM, you have to be aware to uncheck the Enable Secure boot option, otherwise when the VM will boot, the installer will not start.
I’m not going to go through the all installation steps, since that it’s not that difficult, will cover only the network configuration that you have to do after installation is finished.
In order to configure the IP address and make sure that the NIC is enabled when system boots up you have to edit the following file: /etc/sysconfig/network-scripts/ifcg-eth0
After that, you configure your DNS servers from /etc/resolv.conf
After you are done with this you have you restart network running one of the following commands: /etc/init.d/network restart or systemctl restart network.
If you need to configure your NTP servers you can do that by editing the file /etc/ntp.conf
Once you added your NTP servers you have to restart the NTP service: systemctl restart ntpd.