How to configure Portforwarding on KVM Hypervisor?

1

1

I have a Debian install 3.2.68 with KVM/qemu/libvirt as hypervisor.

In "/etc/network/interfaces" I only see eth0 with my static ip, but if I enter "ifconfig" I see also an "virbr0" interface with the ip: 192.168.122.1

The virtual-machines gets dynamic IPs like: 192.168.122.155 with the 192.168.122.1 as gateway.

My Question is:

In which file can I configure the ip and dhcp settings for the virbr0 interface?

How can I set a portforwarding from the static address from the hypervisor to one of the virtual-machines?

Thank you very much.

user2111880

Posted 2015-06-15T20:17:10.083

Reputation: 115

Please clarify which Debien release you’re using. Check /etc/debian_version. – Daniel B – 2015-06-15T20:38:59.453

Debian release: 7.8 – user2111880 – 2015-06-15T20:49:28.390

Answers

0

Josip Rodin

Posted 2015-06-15T20:17:10.083

Reputation: 333

>

  • works perfect, realy easy - 2. i think this is the right solution, i am just a little bit strugeling with the configuration, but this ist a diffrent question ;)
  • < – user2111880 – 2015-06-20T09:26:11.977

    0

    As per https://unix.stackexchange.com/questions/124681/how-to-ssh-from-host-to-guest-using-qemu, this can be configured with the help of -redir tcp:8022::22 and/or -net user,hostfwd=tcp::8022-:22 options of kvm.

    cnst

    Posted 2015-06-15T20:17:10.083

    Reputation: 1 857