0

I'm building a vm client from a host using the virtual network 'default': NAT setting in virt-manager kvm which makes a bridge (virbr0) using my host's nic. The vm client receives the default ip of 192.168.122.x. My other machines on my lan are 192.168.0.x. The client vm can connect to other hosts on my lan and the internet just fine but I can't seem to connect from other hosts (192.168.0.x) to my vm client (192.168.122.x). Does anyone know why?

I've found a workaround for this by using macvtap but I have the opposite problem of being able to connect from other hosts on lan to the vm client but not the host hosting the vm client to the vm itself...

2 Answers 2

0

For Bridge networking to work between host and VM, you have assign same IP address range as that of Host 192.168.0.x

Change this in your KVM bridge network settings, to make it work.

0

In a NAT setup, your VM shares a private network with the host machine only.

This is similar to a network with one gateway server and all workstations reaching the internet through that - the workstations are not reachable from the internet then, either.

You can make single ports of your VM available by using inbound NAT rules on your host system.

# untested
iptables -t nat -A PREROUTING -p tcp --dport 10022 -j DNAT --to 192.168.122.x:22

This rule would make the guest's SSH available via port 10022 on your host system.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .