[libvirt-users] redirect ports from user network

Osier Yang jyang at redhat.com
Thu Dec 29 15:32:50 UTC 2011


On 2011年12月29日 16:38, Алексей Беляев wrote:
> Hello.
> I would like to redirect some ports from user network to host system.
>
> In console i can do it:
> /usr/libexec/qemu-kvm -drive file=/home/libvirt/qemu-fedora.img -vnc
> 10.200.1.1:1 -net user -redir tcp:22000::49999 -redir tcp:22001::22
>
> How can i do it with libvirt?
> I make users network in XML config VM:
>
>   <interface type='user'>
>        <mac address='52:54:00:48:3f:f5'/>
>        <alias name='net0'/>
>        <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
> function='0x0'/>
>      </interface>
>
> But i don't know - how to make redirecting ports and i cann't fint it
> in documentation. Is it possible?
>

The only way to do that is use qemu:commandline. The tests below can
serve the examples to you:

http://libvirt.org/git/?p=libvirt.git;a=tree;f=tests/qemuxmlnsdata;h=36d7c838d7d31461c3028cd866c2565ecf1e23d1;hb=HEAD

We need to support the -redir option. But before we support that,
you can use qemu:commandline instead.

Regards,
Osier




More information about the libvirt-users mailing list