Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The KVM guest network doesn't work. ifconfig shows that eth0 doesn't have any ip address, whereas if I don't use any -net parameters, guest has the network just fine.
Please help.
Thanks
Last edited by sfxpt; 08-18-2010 at 09:40 AM.
Reason: contributing back by concluding in last post.
I removed the promisc parameter from the ifconfig line as I found it wasn't needed and made no difference to performance. I also can't be sure of this, but I think using the promisc flag may introduce a security implication as the guest virtual machine may receive transmissions meant for the real host, i.e allowing packet sniffing on the virtual machine.
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329
Rep:
Did you tried to set a static IP on your VM? what results did you get?
also, the promisc mode *is* needed, to make your virtual switch behave like a real physical switch (doing retransmission of broadcasts and such), AFAIK. if your virtual switch has just one port, then it may work with or without "promisc", but YMMV. For me, it didn't work.
I noticed you're running 2 subnets? I usually run hosts and guests on the same subnet. I used dhcp in the past but now use fixed ip addresses. I also bind both eth0 and tap0 to br0.
Did you tried to set a static IP on your VM? what results did you get?
I totally don' have any idea how the guest VM network would normally be, so last time when I tried, pinging 192.168.1.1 from guest failed with destination unreachable.
Today, I just shoot into the dark and tried again. Hooray, now at least I can ping my host IP now using a static IP. However,
- I can't ping outside my local network
- I tried to setup /etc/resolv.conf but dns look up still fails
- DHCP request still fails
So, great, at least I'm made a great progress. I've seen the light at the end of the tunnel.
- assign an IP address to the virtual machines and make them accessible
from the local network
- leave my physical interface eth0 as is, and only bring up the KVM
bridge device if I am using KVM.
The actual reason behind why I chose the above approach is that I still want my eth0 to be eth0, instead of need to use br0 for all my network applications.
Quote:
Originally Posted by Chuck56
I also bind both eth0 and tap0 to br0.
On seeing this, I now realized that although eth0 doesn't have an IP any more with such setting, it is still *bind* to the bridge device, and I can still use eth0 the same way as before. From the application using eth0 prospective, nothing is changed, right?
... I now realized that although eth0 doesn't have an IP any more with such setting, it is still *bind* to the bridge device, and I can still use eth0 the same way as before. From the application using eth0 prospective, nothing is changed, right?
Correct. You can ifconfig eth0 [up|down] just like before.
For anyone also using Firestarter for Internet Connection Sharing, please note that you will need to change the Firestarter preferences to use br0 as the local network connected device, instead of eth0 (which Firestarter reports as not ready).
this is what I most worry about -- I need to check back my applications one by one. . .
Well if you use Firestarter's Internet Connection Sharing feature then you have the workaround. What other apps do you use that would manipulate the eth0 interface like that?
Did you mean that I should bring up br0 within the same subnet? I just gave that option a try, and the result is that I can't even ping my host from the guest VM.
Here is the log:
Code:
. . . everything same as before. . .
sudo ifconfig br0 192.168.0.10 up
$ ifconfig
br0 Link encap:Ethernet HWaddr 76:0c:3d:fd:74:7d
inet addr:192.168.0.10 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::740c:3dff:fefd:747d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:117 errors:0 dropped:0 overruns:0 frame:0
TX packets:195 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:28408 (27.7 KiB) TX bytes:33537 (32.7 KiB)
eth0 Link encap:Ethernet HWaddr 00:e0:4d:b8:98:ef
inet addr:192.168.0.106 Bcast:192.168.0.255 Mask:255.255.255.0
. . . everything same as before. . .
$ ping 192.168.0.106
PING 192.168.0.106 (192.168.0.106) 56(84) bytes of data.
64 bytes from 192.168.0.106: icmp_req=1 ttl=64 time=0.093 ms
64 bytes from 192.168.0.106: icmp_req=2 ttl=64 time=0.050 ms
64 bytes from 192.168.0.106: icmp_req=3 ttl=64 time=0.053 ms
^C
$ ping 192.168.0.10
PING 192.168.0.10 (192.168.0.10) 56(84) bytes of data.
64 bytes from 192.168.0.10: icmp_req=1 ttl=64 time=0.035 ms
64 bytes from 192.168.0.10: icmp_req=2 ttl=64 time=0.049 ms
^C
kvm -m 1024 -smp 2 -net nic,macaddr=52:54:00:39:81:49 -net tap,ifname=tap0,script=no,downscript=no . . .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.