Using KVM public bridge manually
EDIT:
problem solved, please check out http://www.linuxquestions.org/questi...c-bridge-3107/ or http://www.linuxquestions.org/questi...ml#post4070277 Here is the OP: Hi, Following up on http://www.linuxquestions.org/questi...6/#post3950901 which setup KVM public bridge manually, and referencing another helpful article, KVM network scripts http://blog.bodhizazen.net/linux/kvm_network_scripts/ I am still not able to get my KVM bridge networking works properly. This is what I've been doing on the host side: Code:
$ ifconfig Please help. Thanks |
The variable $iface is possibly the issue:
Change this: -net tap,ifname=$iface,script=no,downscript=no to this: -net tap,ifname=tap0,script=no |
Quote:
$ echo $iface tap0 Yet, I did give your suggestion a try: Code:
$ echo $model |
Are the virtio modules loaded?
Code:
# lsmod | grep virtio |
I believe you should set promiscuous mode on your tap device
Code:
ifconfig $iface 0.0.0.0 promisc up |
Quote:
I've remove the virtio model from the command line and set promiscuous mode on for the tap device, but still no luck. Code:
$ ifconfig Any way that I can troubleshoot this? Thanks |
Quote:
From http://www.linuxquestions.org/questi...6/#post3950901 Quote:
please help. |
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.
Code:
ip addr flush eth0 |
Quote:
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. Any idea why I can't make it totally work? Thanks |
Quote:
http://www.linux-kvm.org/page/Networking#public_bridge The reason was that, I want to setup my KVM bridge so that, - 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:
Thanks |
Quote:
|
> From the application using eth0 prospective, nothing is changed, right?
Quote:
from http://ubuntuforums.org/archive/inde...t-1147139.html Quote:
|
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?
|
Quote:
Here is the log: Code:
. . . everything same as before. . . |
Quote:
|
A bridge is a Layer 2 device, routes by MAC address before IP even comes into play. Both the tap and eth0 have to be bound to the bridge before you assign an IP address to the bridge. Post #9 in this thread gives you the commands for a fixed IP, just replace the last 2 lines with your normal DHCP command if you want a dynamic IP.
|
perhaps you should consider reading this. Old, but still good info.
for now, I will give you some snippets from the HOWTO, for correctness Quote:
Code:
ifconfig bridge0 192.168.0.1 up Code:
ifconfig ethX promisc up Code:
ifconfig ethX 0.0.0.0 promisc up That's the same procedure you should use with TAP interfaces. Quote:
Or you could rename the interface eth0 to peth0 and the bridge0 to eth0, as Xen does. But that's harder to achieve. Quote:
|
Thanks everyone for the reply.
I tried this first: Quote:
Code:
% ifconfig PS. is it possible to revert from this? When my host network is not working, the only solution I have is to reboot. please help. thanks! |
You can't have an ip address assigned to eth0 when your using a bridge. The ifconfig shows eth0 with an ip address after the commands. Are you running something that manages eth0 an reinvokes dhcp? Something like wicd?
|
Quote:
I know that I can't have an ip address assigned to eth0 when using a bridge, but I didn't make the connection why it is still yet even after I zeroed it and my running pump. . . Having killed my pump everything worked fine now. Will conclude in next post. Thanks everyone who helped. Chuck56, you helped me from the start to the end, answered my every question! HasC, thanks for your replies and the useful bridge link! Thanks again. Will contributing back by concluding in next post. |
[Conclusion] Using KVM public bridge manually
Setting up KVM public bridge manually is actually quite easy
: : : EDIT: content removed to avoid duplicated modification. please check out manually setup KVM public bridge instead. : : : That's it. The guests will run on the same subnet as host, having the same route and DNS server. |
All times are GMT -5. The time now is 08:41 AM. |