{"id":343,"date":"2010-12-30T14:44:19","date_gmt":"2010-12-30T14:44:19","guid":{"rendered":"http:\/\/blog.cyberwizzard.nl\/?p=343"},"modified":"2016-03-19T16:44:50","modified_gmt":"2016-03-19T15:44:50","slug":"networking-for-kvm-with-centos-55","status":"publish","type":"post","link":"https:\/\/blog.cyberwizzard.nl\/?p=343","title":{"rendered":"Networking for KVM with CentOS 5.5"},"content":{"rendered":"<p>I&#8217;ve found numerous tutorials to set up KVM\u00a0with CentOS 5.5. Some refer to the Red Hat guides, which are useless in my opinion if you are not using KVM\u00a0in a large server park, others come up with scripts to set up networking.<\/p>\n<p>I kept searching and trying configurations until I\u00a0finally found one that works. Note that among problems you might encounter is the one that plagued me for months:\u00a0CentOS\u00a0is attempting to bring up the virtual device for LAN\u00a0access on the host before bringing up the physical interface, this fails and prevents all networking and dependencies from starting properly.<\/p>\n<p>To set up the bridge devices for KVM\u00a0and the host (something which is done only once to &#8216;wire&#8217; your virtual network instide the bridge) <a href=\"http:\/\/wiki.centos.org\/HowTos\/KVM\">look here<\/a>. Most of the guide is still relevant even if they refer to the Red Hat documentation (which is about Red Hats cloud virtualisation platform and not a single server running KVM).<\/p>\n<p>Use a configuration like this for proper KVM\u00a0networking under CentOS, Red Hat and probably even Fedora.<\/p>\n<p>1. Edit <code class=\"not-hl\">\/etc\/sysconfig\/network-scripts\/ifcfg-eth0<\/code> to contain something like this:<\/p>\n<div class=\"code not-hl code-linenum\">\n<table class=\"probably-non-existing-lang\">\n<tbody>\n<tr class=\"li1\">\n<td class=\"ln\">\n<pre class=\"de1\">1\n2\n3\n4\n5\n6\n7\n<\/pre>\n<\/td>\n<td class=\"de1\">\n<pre class=\"de1\"># \/etc\/sysconfig\/network-scripts\/ifcfg-eth0 - the physical NIC\u00a0which will not be used directly\nDEVICE=eth0\nTYPE=Ethernet\nHWADDR=00:23:B3:16:3F:00\nONBOOT=yes\nBRIDGE=br0\nNM_CONTROLLED=no<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>The &#8220;NM_CONTROLLED&#8221; bit seems to originate from Fedora 12\/13, CentOS\u00a0might ignore it altogether so you could leave it out.<\/p>\n<p>2. Edit <code class=\"not-hl\">\/etc\/sysconfig\/network-scripts\/ifcfg-br0<\/code> to restore network access for your host machine:<\/p>\n<div class=\"code not-hl code-linenum\">\n<table class=\"probably-non-existing-lang\">\n<tbody>\n<tr class=\"li1\">\n<td class=\"ln\">\n<pre class=\"de1\">1\n2\n3\n4\n5\n6\n<\/pre>\n<\/td>\n<td class=\"de1\">\n<pre class=\"de1\"># \/etc\/sysconfig\/network-scripts\/ifcfg-br0 - Bridged network access for host\nDEVICE=br0\nTYPE=Bridge\nBOOTPROTO=dhcp\nONBOOT=yes\nNM_CONTROLLED=no<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>The crucial parts in this configuration is that eth0 is started on boot and is assigned a bridge device:\u00a0&#8216;br0&#8217;. The &#8216;br0&#8217; device is marked as a bridge device which completes the dependencies between them. So make sure if you deviate from the examples you leave the types and &#8216;bridge=br0&#8217; in tact.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve found numerous tutorials to set up KVM\u00a0with CentOS 5.5. Some refer to the Red Hat guides, which are useless in my opinion if you are not using KVM\u00a0in a large server park, others come up with scripts to set up networking. I kept searching and trying configurations until I\u00a0finally found one that works. Note [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[305,450,295],"class_list":["post-343","post","type-post","status-publish","format-standard","hentry","category-linux-gentoolinux","tag-centos","tag-kvm","tag-network"],"views":2832,"_links":{"self":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts\/343","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=343"}],"version-history":[{"count":3,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts\/343\/revisions"}],"predecessor-version":[{"id":535,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=\/wp\/v2\/posts\/343\/revisions\/535"}],"wp:attachment":[{"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cyberwizzard.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}