LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This 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


Reply
  Search this Thread
Old 05-03-2012, 09:01 PM   #1
iwanttolickazunyan
LQ Newbie
 
Registered: May 2012
Posts: 7

Rep: Reputation: Disabled
Exclamation QEMU KVM bridged networking?


Host is Debian 6.0.4 Kernel 3.3.4
QEMU-KVM 1.0.1

I'm trying to make a network bridge for the guest so it can be directly accessed by everything else in LAN, I think I did everything alright but I just cant make the guest get a static IP.
Guest is Windows 2008 R2 Server.
Host have multiple NICs, eth0 that is connected to the network directly and eth1 that is part of bridge br0.

What I want :
Getting guest a static IP.

Guest network will not work if :
- br0 static, guest static at same IP/netmask/subnet/etc.
- br0 static, guest static at different IP with same netmask/subnet/etc
- br0 DHCP, guest static
- br0 DHCP or static, guest getting static IP from DHCP server

Guest network working with :
- br0 DHCP or static, guest DHCP

Below is a picture for br0 DHCP, guest DHCP configuration (working)
http://www.dropmocks.com/mBik49
Below is what I had when host was a Windows 2008 server and what I am aiming to have with current configuration.
http://www.dropmocks.com/mBidFd


I assume I have to do someting with iptables? If yes then how.
Any help would be appreciated.

/etc/network/interfaces for bridge is as follow
eth1 at manual

iface br0 inet dhcp
pre-up ip tuntap add dev tap0 mode tap user root
pre-up ip link set tap0 up
bridge_ports eth1 tap0
bridge_stp off
bridge_maxwait 0
bridge_fd 0
post-down ip link set tap0 down
post-down ip tuntap del dev tap0 mode tap


Guest is running with
-net nic,model=virtio,vlan=1,macaddr=[some random mac]
-net tap,vlan=1,ifname=tap0 plus both the noscript thingy i can't exactly remember so it wont execute qemu-ifup/down script

Last edited by iwanttolickazunyan; 05-04-2012 at 10:34 AM.
 
Old 05-04-2012, 01:24 AM   #2
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
does the NIC br0 is built on have an IP?

and no, you cannot have the same IP on the host and the guest
 
Old 05-04-2012, 01:39 AM   #3
iwanttolickazunyan
LQ Newbie
 
Registered: May 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
eth1 have no IP

I just want the Windows 2008 VM to have static IP that can be accessed by other machines on the network. So anything is fine as long as I can get it to use a static IP.
BTW host have multiple NICs, one is eth0 which gets IP normally and one is eth1 that is used in bridge br0.

Last edited by iwanttolickazunyan; 05-04-2012 at 01:54 AM.
 
Old 05-04-2012, 03:47 AM   #4
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
eth1 connected to the same network as eth0?

The windows VM should have it's own IP, in the same subnet as everything else, consider the bridge a virtual switch, one cable of which is eth1, and the other is the VMs attached to the bridge
 
Old 05-04-2012, 04:12 AM   #5
iwanttolickazunyan
LQ Newbie
 
Registered: May 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
I have only one network. br0(which have eth1 in it) is connected to the same network as eth0.

Basically my network is 192.168.20.x
eth0 which is not bridged to anything is getting 192.168.20.150
eth1 have no IP
br0 have 192.168.20.171
and the VM have 192.168.20.186 (when using DHCP)

Other computers in the network can ping .150, .171 and .186 fine

I want the VM to have a static IP of 192.168.20.200

Last edited by iwanttolickazunyan; 05-04-2012 at 04:14 AM.
 
Old 05-04-2012, 04:26 AM   #6
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
then change the vm's ip in windows
 
Old 05-04-2012, 04:28 AM   #7
iwanttolickazunyan
LQ Newbie
 
Registered: May 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
I did that but it just make networking in windows stopped working completely.

Changing IP in VM with this
http://www.dropmocks.com/mBi0eL
results in broken networking for the VM and getting 169.254.x.x IP

Last edited by iwanttolickazunyan; 05-04-2012 at 10:41 AM.
 
Old 05-04-2012, 11:13 AM   #8
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
sounds like you have a problem in the guest os
 
Old 05-04-2012, 11:21 AM   #9
iwanttolickazunyan
LQ Newbie
 
Registered: May 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
The VMs are migrated from Hyper-V.
I'll try doing fresh installs and post results.
 
  


Reply

Tags
bridged



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
QEMU/KVM Networking Problem theonislair Linux - Newbie 0 03-09-2012 01:11 PM
LXer: How To Install KVM And libvirt On CentOS 6.2 With Bridged Networking LXer Syndicated Linux News 0 03-02-2012 02:20 PM
[Debian/Qemu/KVM] Why qemu --enable-kvm works but not kvm directly? gb2312 Linux - Virtualization and Cloud 2 03-21-2011 02:05 PM
LXer: Attempt of qemu-kvm-0.14 patching via Gerd’s Hoffmann “spice/qxl: locking fix for qemu-kvm” on LXer Syndicated Linux News 0 03-14-2011 01:20 PM
qemu/kvm virsh networking help zoran119 Linux - Virtualization and Cloud 2 12-02-2010 01:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 11:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration