{"id":720,"date":"2013-07-07T19:52:34","date_gmt":"2013-07-08T01:52:34","guid":{"rendered":"https:\/\/mrguitar.net\/?p=720"},"modified":"2015-01-05T11:13:26","modified_gmt":"2015-01-05T17:13:26","slug":"fedora-19-making-libvirt-and-firewalld-play-nice","status":"publish","type":"post","link":"https:\/\/mrguitar.net\/?p=720","title":{"rendered":"Fedora 19. Making libvirt and firewalld play nice"},"content":{"rendered":"<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/fedoraproject.org\/w\/uploads\/8\/86\/Fedora19-release-banner-small.png\" alt=\"\" width=\"200\" height=\"100\" \/><\/p>\n<p style=\"text-align: left;\">I&#8217;ve been running Fedora for quite some type and it&#8217;s hands down my favorite bleeding-edge distro. Since I&#8217;ve been at Red Hat though, I&#8217;ve been using RHEL on my work laptops, and I&#8217;ve really enjoyed the experience and stability. So the past three years it&#8217;s been Fedora at home and RHEL at work, and that&#8217;s worked out perfectly. &#8230;..until now. <!--more-->There are a lot of changes happening upstream that I&#8217;ve found myself starting to fall behind. Things like systemd, firewalld, gnome3, are a few of the bigger changes that come to mind. RHEL 7 is looking like it&#8217;s largely going to be based on F19, but it wouldn&#8217;t surprise me if a couple things from F20 make it as well. Anyway, it&#8217;s time I get up to speed with what&#8217;s coming in RHEL7 and the best way to do that is to run Fedora on *everything*. So far I&#8217;ve got F19 running on 4x boxes and I still have 3 more to upgrade. Here&#8217;s a quick thing I ran into this afternoon:<\/p>\n<p>libvirt &amp; firewalld: I was really surprised that the default libvirt network was not already running on my system. I was able to easily create it via virt-manager. I stuck to the same 192.168.122.0\/24 network, but it wouldn&#8217;t accept the name &#8220;default&#8221; so I used &#8220;local&#8221;. Next, I had to get PXE working so I added the tftp &amp; bootp lines with `virsh net-edit local`.<br \/>\n<code><br \/>\n&lt;network&gt;<br \/>\n&lt;name&gt;local&lt;\/name&gt;<br \/>\n&lt;uuid&gt;bcf7e69f-838a-488e-b1ec-6d01566d3a05&lt;\/uuid&gt;<br \/>\n&lt;forward mode='nat'\/&gt;<br \/>\n&lt;bridge name='virbr0' stp='on' delay='0' \/&gt;<br \/>\n&lt;mac address='52:54:00:49:92:da'\/&gt;<br \/>\n&lt;domain name='local'\/&gt;<br \/>\n&lt;ip address='192.168.122.1' netmask='255.255.255.0'&gt;<br \/>\n<strong>&lt;tftp root='\/var\/lib\/tftpboot' \/&gt;<\/strong><br \/>\n&lt;dhcp&gt;<br \/>\n&lt;range start='192.168.122.128' end='192.168.122.254' \/&gt;<br \/>\n<strong>&lt;bootp file='pxelinux.0' \/&gt;<\/strong><br \/>\n&lt;\/dhcp&gt;<br \/>\n&lt;\/ip&gt;<br \/>\n&lt;\/network&gt;<br \/>\n<\/code><br \/>\nEverything seemed good at this point until I noticed that none of my guests could communicate w\/ the host. This turned out to be a firewalld issue. First the interface needs to be added to firewalld: <code>`sudo firewall-cmd --permanent --zone=trusted --add-interface=virbr0`<\/code> This makes firewalld aware of the interface and places it in the trusted zone so that all traffic is passed. The<code> permanent argument does not effect the running config. For the changes to take effect run `sudo firewall-cmd --reload.`<\/code> At first I found this really annoying to have to deal with, but now that I dug into it a little bit it&#8217;s actually a really nice setup.<\/p>\n<p>Of course you can disable firewalld and do everything with static iptables rules (lokkit), but I think there&#8217;s a lot of good functionality here, and I&#8217;m excited to learn more. Here&#8217;s a link to the <a href=\"https:\/\/fedoraproject.org\/wiki\/FirewallD\" target=\"_blank\"> wiki.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been running Fedora for quite some type and it&#8217;s hands down my favorite bleeding-edge distro. Since I&#8217;ve been at Red Hat though, I&#8217;ve been using RHEL on my work laptops, and I&#8217;ve really enjoyed the experience and stability. So the past three years it&#8217;s been Fedora at home and RHEL at work, and that&#8217;s &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/mrguitar.net\/?p=720\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Fedora 19. Making libvirt and firewalld play nice&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[32],"class_list":["post-720","post","type-post","status-publish","format-standard","hentry","category-open-sourcenerd-stuff","tag-fedora"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mrguitar.net\/index.php?rest_route=\/wp\/v2\/posts\/720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mrguitar.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mrguitar.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mrguitar.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mrguitar.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=720"}],"version-history":[{"count":15,"href":"https:\/\/mrguitar.net\/index.php?rest_route=\/wp\/v2\/posts\/720\/revisions"}],"predecessor-version":[{"id":1281,"href":"https:\/\/mrguitar.net\/index.php?rest_route=\/wp\/v2\/posts\/720\/revisions\/1281"}],"wp:attachment":[{"href":"https:\/\/mrguitar.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mrguitar.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mrguitar.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}