<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 01/03/2017 06:44 PM, Omer Aldemir
      wrote:<br>
    </div>
    <blockquote
cite="mid:AMSPR06MB27741C9A88F19B98D1F9554B86E0@AMSPR06MB277.eurprd06.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div>Thanks for the answers i think open network type is not
        available yet on the version that comes with rhel7<br>
      </div>
    </blockquote>
    <br>
    <br>
    Actually it is in RHEL 7.3. Although the feature is in upstream
    libvirt only starting in version 2.2.0, and RHEL7.3 libvirt is based
    on libvirt 2.0.0, certain patches are backported into RHEL packages
    based on severity of bug vs. potential for introducing regressions
    vs. customer demand. This particular patch was backported into
    RHEL7.3 for <a class="moz-txt-link-freetext" href="https://bugzilla.redhat.com/846810">https://bugzilla.redhat.com/846810</a><br>
    <br>
    <br>
    <blockquote
cite="mid:AMSPR06MB27741C9A88F19B98D1F9554B86E0@AMSPR06MB277.eurprd06.prod.outlook.com"
      type="cite">
      <div>
        On 3 Jan 2017, at 22:06, Laine Stump <<a
          moz-do-not-send="true" href="mailto:laine@laine.org">laine@laine.org</a>>
        wrote:<br>
        <br>
      </div>
      <blockquote type="cite">
        <div>
          <div class="moz-cite-prefix">On 12/22/2016 09:48 AM, Omer
            Aldemir wrote:<br>
          </div>
          <blockquote
cite="mid:AMSPR06MB277EBC427FC12F38F37BA32B8920@AMSPR06MB277.eurprd06.prod.outlook.com"
            type="cite">
            <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;"
              dir="ltr">
              <p>Hello,</p>
              <p><br>
              </p>
              <p>I am trying to understand how libvirt firewall rules
                are loaded as I have firewalld and iptables services are
                disabled.</p>
            </div>
          </blockquote>
          <br>
          libvirt will add its iptables rules via firewalld if firewalld
          is enabled and running, otherwise it executes iptables
          commands directly.<br>
          <br>
          w<br>
          <blockquote
cite="mid:AMSPR06MB277EBC427FC12F38F37BA32B8920@AMSPR06MB277.eurprd06.prod.outlook.com"
            type="cite">
            <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;"
              dir="ltr">
              <p><br>
              </p>
              <p>Where is the configuration files for firewall and NAT 
                rules for libvirt?</p>
            </div>
          </blockquote>
          <br>
          There are no configuration files for the iptables rules that
          libvirt adds. The simple set of rules that is added is fixed
          for each type of libvirt network - NAT, routed, and isolated.
          Here is a description of exactly what is added for each of
          these types of network:<br>
          <br>
             <a moz-do-not-send="true" class="moz-txt-link-freetext"
            href="https://libvirt.org/firewall.html">https://libvirt.org/firewall.html</a><br>
          <br>
          (actually I just realized that I forgot to add information
          there about a new network forwarding type I recently added -
          "open", which doesn't add *any* iptables rules - this is
          intended for those who want to do their own iptables setup for
          libvirt networks, outside of libvirt.)<br>
          <br>
          <blockquote
cite="mid:AMSPR06MB277EBC427FC12F38F37BA32B8920@AMSPR06MB277.eurprd06.prod.outlook.com"
            type="cite">
            <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;"
              dir="ltr">
              <p>How can I load default firewall rules if I mess things
                up</p>
            </div>
          </blockquote>
          <br>
          To reload all the iptables rules for all active libvirt
          networks, just restart the libvirtd service.<br>
          <br>
          <blockquote
cite="mid:AMSPR06MB277EBC427FC12F38F37BA32B8920@AMSPR06MB277.eurprd06.prod.outlook.com"
            type="cite">
            <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;"
              dir="ltr">
              <p><br>
              </p>
              <p>Also I have realized that followings is default </p>
              <p><br>
              </p>
              <p><span>ACCEPT     all  --  0.0.0.0/0           
                  192.168.122.0/24     ctstate RELATED,ESTABLISHED</span></p>
              <p><span><br>
                </span></p>
              <p><span>but If I am to forward a port for a real IP to
                  internal guest machine I need
                </span></p>
              <p><span><br>
                </span></p>
              <p><span><span>ACCEPT     all  --  0.0.0.0/0           
                    192.168.122.0/24     state NEW,RELATED,ESTABLISHED</span></span></p>
              <p><span><br>
                </span></p>
              <p><span>(NEW state is required) and also of course a
                  forwarding rule</span></p>
              <p><span><br>
                </span></p>
              <p><span><span>iptables -t nat -I PREROUTING -p tcp
                    --dport 3389 -j DNAT --to-destination
                    192.168.122.16:3389</span></span></p>
              <p><span><br>
                </span></p>
              <p><span>Is there a place I can make this rules static
                  with LibVirt (not playing with firewalld  and/or
                  iptables service for Centos 7)</span></p>
            </div>
          </blockquote>
          <br>
          The best that can be done with current libvirt is to create a
          "hook" script similar to the one described here:<br>
          <br>
          <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="https://wiki.libvirt.org/page/Networking#Forwarding_Incoming_Connections">https://wiki.libvirt.org/page/Networking#Forwarding_Incoming_Connections</a><br>
          <br>
          (That worked the last time I tried it, but that was at least 3
          years ago. The python script available as a link from that
          page is newer and promises to be easier to understand (maybe))<br>
        </div>
      </blockquote>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
libvirt-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:libvirt-users@redhat.com">libvirt-users@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/libvirt-users">https://www.redhat.com/mailman/listinfo/libvirt-users</a></pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>