<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Vorformatiert Zchn";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.HTMLVorformatiertZchn
{mso-style-name:"HTML Vorformatiert Zchn";
mso-style-priority:99;
mso-style-link:"HTML Vorformatiert";
font-family:"Courier New";
mso-fareast-language:DE;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hi,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I wan’t to add iptables rules between existing rules and the rules created by libvirt (forward type=nat).<o:p></o:p></p><pre>I did try the hook<br><br>/etc/libvirt/hooks/network network_name start begin -<br><br>and<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>/etc/libvirt/hooks/network network_name started begin -<br><br>It seems like the libvirt iptables rules are already inserted when<br>this hook is executed.<br><br>Simply use –I instead of –A does not work either because the rules should be <br>inserted between the existing one and the libvirt rules. Also the custom rules should be deleted after<br>the hoook<br><br>/etc/libvirt/hooks/network network_name stopped end -<o:p></o:p></pre><pre><br>is executed.<br><br>Does a hook exists which is executed after the network is started but before the<br>libvirt rules are inserted?<br><br>Is it possible the use a custom chain for the libvirt iptables rules instead of directly writing <br>them into the INPUT chain?<br><br>I think of some thing like INPUT<br><br>VIRT_VIBR0 all -- * virbr0 0.0.0.0/0 0.0.0.0/0 <o:p></o:p></pre><pre>VIRT_VIBR0 all -- virbr0 * 0.0.0.0/0 0.0.0.0/0 <br><br><o:p></o:p></pre><pre>and VIRT_VIBR0 <o:p></o:p></pre><pre><o:p> </o:p></pre><pre>ACCEPT all -- * virbr0 0.0.0.0/0 192.168.122.0/24 state RELATED,ESTABLISHED<o:p></o:p></pre><pre>ACCEPT all -- virbr0 * 192.168.122.0/24 0.0.0.0/0<o:p></o:p></pre><pre>ACCEPT all -- virbr0 virbr0 0.0.0.0/0 0.0.0.0/0<o:p></o:p></pre><pre>REJECT all -- * virbr0 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable<o:p></o:p></pre><pre>REJECT all -- virbr0 * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable<o:p></o:p></pre><pre><o:p> </o:p></pre><pre><br>thanks & regards<br>dieter<o:p></o:p></pre><pre><o:p> </o:p></pre><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>