e-info128
e-info128

Reputation: 4072

How can I change interface to user in KVM?

I using KVM on CentOS 7 with Virsh, but I cannot edit guest XML setting from interface network to interface user.

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
    ...
    <interface type='user'>
        ...
    </interface>
    <qemu:commandline>
        <qemu:arg value='-redir'/>
        <qemu:arg value='udp:1194::1194'/>
    </qemu:commandline>
</domain>

The error catch in <interface type='user'>:

Error:XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng Extra element devices in interleave Element domain failed to validate content

What is the problem? Is it the version of KVM? How can I open a VPN port from guest to the internet using only KVM without iptables or fwd?

Upvotes: 0

Views: 1480

Answers (1)

sgohl
sgohl

Reputation: 412

If someone like me is still looking for a simple&dirty(!) solution, I now decided to use the tcpproxy written by https://github.com/kklis:

# yum install git kernel-devel
# git clone https://github.com/kklis/proxy /usr/local/bin/
# cd /usr/local/bin/proxy && make

then you run just like this:

# ./proxy -l 88 -h 192.168.122.153 -p 80

use your imagination to manage the rules, auto(re)start behaviour and justify usage to your needs.

Upvotes: 2

Related Questions