> Under my new KVM config I've realised that
vnet<X> is brought up in a 'first free' fashion as
opposed to a counter in the Xen case. This leaves me
scratching my head a little bit, say I have a domain which
has ended up with ID = 8, but may for instance have network
'vnet1' associated with it. I'm not sure how I can determine
any association between the domain & which interface
belongs to it! (e.g. a call to domain.interfaceStats()
requires the correct network interface as a parameter).
>
> Surely I must be missing something here? Anyone have
any advice/workaround for this situation? Ideally I would
like to either be able to hardcode vnet-labels in the XML
description (tried but it's ignored), or otherwise keep vnet
numbering in sync with domain ID.
Ask libvirt for the XML config while the domain is
running, you should
see the interface there I think, try "virsh dumpxml 8"
Hi Daniel, thanks for your fast reply. Yes you're right I can do that and parse the
XML (possibly not so elegant but I've tested it and it works! :-)
But I have another question for you.. I would now like to apply iptables rules similar to
Xen antispoofing (i.e. lock an IP to a vnet<X> interface). Can you recommend the
best place to integrate this functionality? Are there some script hooks? I.e. if I try to
add <interface>..<ip />..<script path='/some/script'/>
</interface> to my domain definition would it pass the IP address & interface to
the script (as what seems to happen with the Xen driver?) or am I approaching this the
wrong way again?
Thanks in advance,
Ravi