1

In my home network, I have two physical machines. One of them is running ubuntu hosting a VM. The other one is a laptop. From my laptop I can access my ubuntu but I cannot access the VM.

Laptop IP: 192.168.0.60
Ubuntu IP: 192.168.0.229
VM IP:     192.168.122.220

When I run ifconfig I see there are two interfaces (plus loopback), one eth0 and one vibr0, presumably for the VMs:

eth0      Link encap:Ethernet  HWaddr 00:25:64:b4:80:da
      inet addr:192.168.0.229  Bcast:192.168.0.255  Mask:255.255.255.0
      inet6 addr: fe80::3b29:a5ac:da9f:4e71/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:114 errors:0 dropped:0 overruns:0 frame:0
      TX packets:158 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:14089 (14.0 KB)  TX bytes:22650 (22.6 KB)
      Interrupt:21 Memory:f7ae0000-f7b00000


virbr0    Link encap:Ethernet  HWaddr 00:00:00:00:00:00
      inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

I tried configuring ubuntu as a router by following the instructions here http://opensourceforu.com/2015/04/how-to-configure-ubuntu-as-a-router/ replacing "eth1" with "vibr0" but pinging the VM from my laptop still reports "Destination host unreachable".

5
  • 2
    If you can configure your VM's interface in bridged mode, just do that, it's the simplest solution.
    – fkraiem
    Oct 18, 2016 at 13:36
  • 2
    Can't you configure the VM to be on the same subnet? Your VM's IP is on 192.168.122.N while the rest of your network is on 192.168.0.N
    – terdon
    Oct 18, 2016 at 13:36
  • Agreed with both comments here so far. Unless you can add the routing to a DNS server that your laptop can see, your laptop does not know where 192.168.222.N network is. For your situation, you would be better off in bridged mode allowing your VM to be on the same subnet as the rest of the network.
    – Terrance
    Oct 18, 2016 at 13:47
  • Virtual Machine Manager won't let me change the networking mode. I could re-create the VM in a new network mode but I'd rather not.
    – Ya.
    Oct 18, 2016 at 13:50
  • Ait, added a new bridged NIC to the VM and removed the NAT-ted one and seems to work. Thanks.
    – Ya.
    Oct 18, 2016 at 14:21

0

You must log in to answer this question.

Browse other questions tagged .