2

I have created two virtual machines in virt-manager. All machines (host & guests) run Ubuntu 14.04.

Host machine has two NICs. eth1 is used by host. Virtual Network Interface for each VM/guest is set to Host device eth0: macvtap.

  • Host IP is 192.168.1.35
  • Guest 1 IP is 192.168.1.41
  • Guest 2 IP is 192.168.1.54

I can ping host from guest and guest from host. But guests are not reachable from each other. When I ping guest 2 from guest 1, output of tcpdump at host is:

17:55:11.631825 ARP, Request who-has 192.168.1.54 tell 192.168.1.41, length 28
17:55:12.631626 ARP, Request who-has 192.168.1.54 tell 192.168.1.41, length 28
17:55:13.632127 ARP, Request who-has 192.168.1.54 tell 192.168.1.41, length 28
...

Similarly, when I ping guest 1 from guest 2:

17:57:39.509281 ARP, Request who-has 192.168.1.41 tell 192.168.1.54, length 28
17:57:40.509280 ARP, Request who-has 192.168.1.41 tell 192.168.1.54, length 28
17:57:41.526726 ARP, Request who-has 192.168.1.41 tell 192.168.1.54, length 28
....

Both guests have following network configuration:

/etc/network/interfaces
    auto lo
        iface lo inet loopback
    auto eth1
        iface eth1 inet dhcp

route -n
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
    192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1       

iptables -L
    (nothing)

ifconfig (Guest 1)
    eth1      Link encap:Ethernet  HWaddr 52:54:00:ab:e6:fa  
              inet addr:192.168.1.41  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::5054:ff:feab:e6fa/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:728 errors:0 dropped:0 overruns:0 frame:0
              TX packets:638 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:817117 (817.1 KB)  TX bytes:51190 (51.1 KB)

    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:16 errors:0 dropped:0 overruns:0 frame:0
              TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:1184 (1.1 KB)  TX bytes:1184 (1.1 KB)

Host:

/etc/network/interfaces
    auto lo
    iface lo inet loopback

route -n
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
    192.168.1.0     0.0.0.0         255.255.255.0   U     1      0        0 eth1

iptables -L
    (nothing)

ifconfig
    eth0      Link encap:Ethernet  HWaddr 08:62:66:26:eb:d8  
              inet6 addr: fe80::a62:66ff:fe26:ebd8/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:218 errors:0 dropped:0 overruns:0 frame:0
              TX packets:110 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:67520 (67.5 KB)  TX bytes:20012 (20.0 KB)

    eth1      Link encap:Ethernet  HWaddr 70:62:b8:b5:2c:1b  
              inet addr:192.168.1.35  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::7262:b8ff:feb5:2c1b/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:4100 errors:0 dropped:0 overruns:0 frame:0
              TX packets:4678 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:1030310 (1.0 MB)  TX bytes:834427 (834.4 KB)

    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:15192 errors:0 dropped:0 overruns:0 frame:0
              TX packets:15192 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:1386699 (1.3 MB)  TX bytes:1386699 (1.3 MB)

    macvtap0  Link encap:Ethernet  HWaddr 52:54:00:db:29:6c  
              inet6 addr: fe80::5054:ff:fedb:296c/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:19 errors:0 dropped:0 overruns:0 frame:0
              TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:500 
              RX bytes:2286 (2.2 KB)  TX bytes:5930 (5.9 KB)

    macvtap1  Link encap:Ethernet  HWaddr 52:54:00:ab:e6:fa  
              inet6 addr: fe80::5054:ff:feab:e6fa/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:29 errors:0 dropped:0 overruns:0 frame:0
              TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:500 
              RX bytes:4395 (4.3 KB)  TX bytes:7980 (7.9 KB)
  • For a good start - have you enabled ipv4 forwarding? You can check it either this way: cat /proc/sys/net/ipv4/ip_forward (0 is disabled, 1 enabled), or running the command: sysctl net.ipv4.ip_forward – Jacek Aug 4 '15 at 13:45
  • yes, ip4 forwarding is enabled (at host) – user302681 Aug 4 '15 at 13:58
  • OK - can you provide us with more details about your network configuration on each of systems: hypervisor and both guests, please? – Jacek Aug 4 '15 at 14:18
  • I added more info – user302681 Aug 4 '15 at 15:39
1

Replacing eth0 with a bridge interface solved the problem. But, there is another issue: low-internet-speed-when-adding-bridge-interface

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.