KVM Virtual Machine's - Can't get ping each other or host

We have Virtual Machines operating within the KVM environment.  We setup one as a dev server running apache etc and the other as a Windows development environment.

The two environments are setup and running fine.  However, they cannot ping (see) each other.  I am wondering if there is a clear solution to this.

This is what is happening.

From Host:
      Cannot ping either of 2 VM's (one linux, one windows)

From Either of the VM's:
      Cannot ping host
      Cannot ping each other

From other network machines (for instance my laptop from within my company network)
      Successfully ping host at 192.168.0.64
      Successfully ping VM1 (Linux) 192.168.0.43
      Successfully ping VM2 (Windows) 192.168.0.84

What sayeth the group ?

Jay Lepore
CompuMatter
Jay LeporeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Daniel HelgenbergerCommented:
Please elaborate on your network setup:
1) Are the virtual NiCs assigned to a bridge?
2) Do they have more then one virtual NIC each?
3) can they ping anything else in their subnet?

On the Linux machine, post the output of:
ifconfig

Open in new window

And the output from Windows's :
ipconfig /all

Open in new window

0
Jay LeporeAuthor Commented:
This is new territory to me but I pay attention and will be able to resolve with guidance.

The answers are:

1) 'what is a virtual NIC' and how would I assign them to a bridge ;-)  
2) see response 1)
3) They seem to be able to ping everything else in their subnet

They can also ping the Internet normally.

The results of ifconfig / ipconfig are:

-------------------------------------
LINUX VM
-------------------------------------
jay@staging:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 52:54:00:8e:ef:a8  
          inet addr:192.168.0.43  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::5054:ff:fe8e:efa8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:16289 errors:0 dropped:199 overruns:0 frame:0
          TX packets:4806 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:8438459 (8.4 MB)  TX bytes:442562 (442.5 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:1218 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1218 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:405561 (405.5 KB)  TX bytes:405561 (405.5 KB)

jay@staging:~$


-------------------------------------
WINDOWS VM
-------------------------------------
Windows IP Configuration

   Host Name . . . . . . . . . . . . : Jay-PC
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Realtek RTL8139C+ Fast Ethernet NIC
   Physical Address. . . . . . . . . : 52-54-00-6F-09-4D
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . :
fe80::24b7:c441:7a3b:a956%11(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.0.84(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : Tuesday, October 22, 2013 3:08:10
PM
   Lease Expires . . . . . . . . . . : Wednesday, October 23, 2013 3:08:09
PM
   Default Gateway . . . . . . . . . : 192.168.0.1
   DHCP Server . . . . . . . . . . . : 192.168.0.1
   DHCPv6 IAID . . . . . . . . . . . : 240276480
   DHCPv6 Client DUID. . . . . . . . :
00-01-00-01-19-F6-B3-EC-52-54-00-6F-09-4D
   DNS Servers . . . . . . . . . . . : 192.168.0.1
   NetBIOS over Tcpip. . . . . . . . : Enabled

Tunnel adapter isatap.{3E4746A0-86FD-449C-978C-F423EF8A49AE}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter Local Area Connection* 11:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   IPv6 Address. . . . . . . . . . . :
2001:0:5ef5:79fd:2c2d:20e2:3f57:ffab(Preferred)
   Link-local IPv6 Address . . . . . :
fe80::2c2d:20e2:3f57:ffab%13(Preferred)
   Default Gateway . . . . . . . . . : ::
   NetBIOS over Tcpip. . . . . . . . : Disabled


Thank you.

Jay Lepore
CompuMatter
0
Jay LeporeAuthor Commented:
Also, here is a screen shot of the two VM's network settings that might also be of value
VM Network Settings
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Daniel HelgenbergerCommented:
Hello Jay,
thanks for the config - picture.
The problem is you are using 'macvtap' as network device for the VMs. best practice is to bridge one interface of your hypervisor host.
Now, this is important: I think from your last posts you are running Debian/Ubuntu?
If so, I think it is best to define static (system) interfaces with a bride. Image this bride lie a switch, where you plug in your VMs.

I do give you a hint how to create a persistent bridge with /etc/network/interfaces and your system eth0 interface. Replace eth0 with your main network interface on your KVM host (from the picture, it should be eth0 anyway). In this config, there should also be your system eth0 defined. It is not desirable to let any network connections on the KVM host be handled by NetworkManager.

So, open a terminal:
$ sudo gedit /etc/network/interfaces
# add these lines:
# Bridge between eth0
auto br0
iface br0 inet static
  pre-up ip link set eth0 down
  pre-up brctl addbr br0
  pre-up brctl addif br0 eth0
  pre-up ip addr flush dev eth0
  post-down ip link set eth0 down
  post-down ip link set br0 down
  post-down brctl delif br0 eth0
  post-down brctl delbr br0
# save the file
# restart network
$ sudo /etc/init.d/networking restart
# check if the interface is there and up: 
$ ifconfig

Open in new window


Now, in VirtManager, assign this bridge to the network connections of the VMs and restart them. They should now behave like any other computer on your network.

Please also see this guide on how to create a bridge:
https://help.ubuntu.com/community/NetworkConnectionBridge
Note 1: there is also function in VM Manager, in Edit/Connection Details/Network connections/ + Button. It did not work stable the last time I tried (RedHad) - but do not know if it works better now.
Note 2: I did not assign an IP to the bridge. Though you can do this, it is best practice not to assign one.
0
Jay LeporeAuthor Commented:
I had inserted these commands in /etc/network/interfaces but restarting the network generated these errors:

root@vmhost:/etc/network# sudo /etc/init.d/networking restart

 * Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
 * Reconfiguring network interfaces...                                                                                                       Ignoring unknown interface eth0=eth0.
Missing required variable: address
Missing required configuration variables for interface br0/inet.
Failed to bring up br0.
0
Daniel HelgenbergerCommented:
Sorry, my bad! Please change 'static' to 'manual' and restart network again:
....
iface br0 inet manual
...

Open in new window

I hope this works :)
0
Jay LeporeAuthor Commented:
After performing the latest suggestion above, I found I could no longer SSH into the host machine.

When I did a hands on host reboot and ifconfig, this is what it showed me:

ifconfig after clean boot
0
Daniel HelgenbergerCommented:
Hm, true things are true: I have to little info about your system and my Debian days are long past. Sorry for that.

So:
1. reverse settings in /etc/network/interfaces
2. Tell me your OS and post ifconfig, when eth0 is up again.
3. tell me if eth0 is your only interface or if you have another physical interface (witch would be a good thing)

Later on:
- add eth0 to /etc/network/interfaces
- disable network-manager
- change the interface to br0 in vm settings
here is a good guide.
https://wiki.ubuntu.com/KvmWithBridge

Also, please read a guide about best practices for Ubuntu as KVM host
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.