{"id":496,"date":"2018-09-06T12:43:13","date_gmt":"2018-09-06T12:43:13","guid":{"rendered":"http:\/\/michaelstoica.com\/?p=496"},"modified":"2018-09-06T12:43:13","modified_gmt":"2018-09-06T12:43:13","slug":"how-to-configure-networking-on-centos","status":"publish","type":"post","link":"https:\/\/michaelstoica.com\/site\/how-to-configure-networking-on-centos\/","title":{"rendered":"How to configure networking on CentOS"},"content":{"rendered":"<p>It&#8217;s been quite a while since my last post on the blog, but now I&#8217;m back with a post regarding networking on CentOS. I did some work with CentOS in the past few months and I thought that&#8217;s good to have the information on the blog as well. Have to mention that I&#8217;m not an expert on Linux.<\/p>\n<p>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\u00a0 Enable Secure boot option, otherwise when the VM will boot, the installer will not start.<\/p>\n<p>I&#8217;m not going to go through the all installation steps, since that it&#8217;s not that difficult, will cover only the network configuration that you have to do after installation is finished.<\/p>\n<p>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:\u00a0<em>\/etc\/sysconfig\/network-scripts\/ifcg-eth0<\/em><\/p>\n<p><a href=\"https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/09\/centos1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-499\" src=\"https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/09\/centos1.png\" alt=\"\" width=\"433\" height=\"27\" srcset=\"https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/09\/centos1.png 433w, https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/09\/centos1-300x19.png 300w\" sizes=\"auto, (max-width: 433px) 100vw, 433px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/09\/centos2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-500\" src=\"https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/09\/centos2.png\" alt=\"\" width=\"636\" height=\"867\" srcset=\"https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/09\/centos2.png 636w, https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/09\/centos2-220x300.png 220w\" sizes=\"auto, (max-width: 636px) 100vw, 636px\" \/><\/a><\/p>\n<p>After that, you configure your DNS servers from\u00a0<em>\/etc\/resolv.conf<\/em><\/p>\n<p><a href=\"https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/09\/centos3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-501\" src=\"https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/09\/centos3.png\" alt=\"\" width=\"250\" height=\"22\" \/><\/a><\/p>\n<p>After you are done with this you have you restart network running one of the following commands:\u00a0<em>\/etc\/init.d\/network restart or systemctl restart network.<\/em><\/p>\n<p>If you need to configure your NTP servers you can do that by editing the file\u00a0<em>\/etc\/ntp.conf\u00a0<\/em><\/p>\n<p><a href=\"https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/09\/centos4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-502\" src=\"https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/09\/centos4.png\" alt=\"\" width=\"692\" height=\"862\" srcset=\"https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/09\/centos4.png 692w, https:\/\/michaelstoica.com\/site\/wp-content\/uploads\/2018\/09\/centos4-241x300.png 241w\" sizes=\"auto, (max-width: 692px) 100vw, 692px\" \/><\/a><\/p>\n<p>Once you added your NTP servers you have to restart the NTP service:\u00a0<em>systemctl restart ntpd.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s been quite a while since my last post on the blog, but now I&#8217;m back with a post regarding networking on CentOS. I did&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/michaelstoica.com\/site\/how-to-configure-networking-on-centos\/\">Continue reading<span class=\"screen-reader-text\">How to configure networking on CentOS<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[36,35,37],"class_list":["post-496","post","type-post","status-publish","format-standard","hentry","category-general","tag-centos","tag-linux","tag-networking","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p63Lge-80","_links":{"self":[{"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/posts\/496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/comments?post=496"}],"version-history":[{"count":3,"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/posts\/496\/revisions"}],"predecessor-version":[{"id":503,"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/posts\/496\/revisions\/503"}],"wp:attachment":[{"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/media?parent=496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/categories?post=496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michaelstoica.com\/site\/wp-json\/wp\/v2\/tags?post=496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}