I am running a Virtual Machine on a Host that is hardwired to my LAN. The Host shows up on my local network (as do the other Hosts connected by Wifi) but the VM Guest does not. Initially this was because the VM Guest was NATed from the Host. The VM Guest could reach the internet and other servers on my LAN but other servers could not reach it. This makes sense. What I want to have happen is the Guest VM show up on the network as if they were hardwired directly to it like the host. For the life of me I cannot figure out what I am missing.
I have a basic home network setup. It looks like the following image:
- Netgear Nighthawk wifi/router
- Intel NUC host hardwired to router
- Ubuntu Server OS
- KVM/QEMU virtualization
I initially set up the VM with the NATed configuration like so (the default network is the NATed bridged network):
The above worked great but again, I could not reach the VMs from other devices on the LAN (because they VMs were NATed).
I then tried to set up a Routed configuration so that each VM would get their own IP and could:
- reach the internet
- be reachable from other hosts on the LAN
With the above setup however the VM cannot reach the internet and is not reachable from other hosts on the network. It is almost is if I somehow set things up in a DMZ behind the Host.
From everything I've read, setting up the Routed configuration (through virbr3 as in the image above) should create a Virtual Network on the Host that is of type "Routed" which will cause the Host to just pass through. I can see on the Host's ARP table that it knows about the VM Guest:
What I would expect to see when I log into my Netgear router is the VM Guest listed as a wired connection, but it is not listed. I tried to go in to the router and manually and add a reserved IP address for the IP of the VM Guest (and the VM Guest's MAC Address) thinking that network requests for that IP would be routed appropriately, but they are not. It is almost as if the Host knows about the VM but is not advertising the routes correctly and the router doesn't know about the Guest VM so that when I try to ping the Guest's IP from a different Host on the LAN the router doesn't know where to send it? Any suggestions on how to remedy this?
I realized one step missing was adding a static route in my NetGear router so that it knew where to forward requests to the IP addresses associated with VMs (through the eth0 gateway). Now I can ping the VMs from other hosts on the network so that is a huge step forward. The only remaining issue is that now the VMs can't reach the internet (i.e. google.com).
192.168.100.1 is the local gateway.
192.168.1.1 is my wireless gateway I believe. I'm making this call because it shows up as the default gateway on the Host and on my Mac which is also connected to the LAN.