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 02-17-2013, 03:22 PM   #1
Air-Global
Member
 
Registered: Dec 2012
Location: The Netherlands
Distribution: Fedora 27 & CentOS 7
Posts: 62

Rep: Reputation: 8
Network setup KVM guest to use eth0 as is. on CentOS


Hi,

I have been setting up my KVM guests on my CentOS server and ive run into a problem with a Windows Server.

The problem cant be solved at the guest Windows side, but might be solved on the Host/kvm settings side. But ill need some help on those parts.


What I want:
Send a specific DHCP request, and get the reply to that

What I tried:
Bridge network with the settings correct in the guest -> not the desired result
Setted up eth0 on the host as desired -> get the correct DHCP reply, but at the host ofc

What I think will solve my problems with the DHCP request:
Get a DHCP request with eth0 on the host
Have the KVM Guest use that eth0 and be able to send all his requests over that port and get feedback over that port.


Some side information:
eth0 will only be used by that Guest. So it can claim eth0 if needed
Current setup:

ifcfg-eth0 (note that the commented out are needed for it to work like desired on host but then BRIDGE will be commented out)
Code:
DEVICE="eth0"
#BOOTPROTO="dhcp"
HWADDR="90:E6:BA:**:**:**"
#MACADDR="00:02:02:**:**:**"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
IPV4_FAILURE_FATAL="no"
DEFROUTE="yes"
BRIDGE="br0"
ifcfg-br0
Code:
DEVICE="br0"
BOOTPROTO="dhcp"
ONBOOT="yes"
TYPE="Bridge"
IPV4_FAILURE_FATAL="no"
dhclient-eth0.conf (needed for the dhcp to work correctly when using the host to connect)
Code:
request subnet-mask, time-offset, routers, domain-name-servers, host-name, domain-name, root-path, default-ip-ttl, broadcast-address, perform-mask-discovery, router-discovery, static-routes, nis-domain, nis-servers, ntp-servers, vendor-encapsulated-options;
send dhcp-max-message-size 548;
send vendor-encapsulated-options 03:09:61:6d:69:6e:65:74:31:33:30:04:05:66:69:73:79:73;
send vendor-class-identifier "Aminoaminet130fisys";
So in short, when connecting on the CentOS host it works. When connecting with the 'same' settings in Windows it wont when bridged.

Bridged networking is kind of all i have experience with with KVM, if someone could help me setting up in a way that i can get a DHCP setup on the HOST and just forward it all to the client that would be wonderfull

Thank you,
Martin
 
Old 02-17-2013, 06:00 PM   #2
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158
Tried IOMMU (PCI passthrough)? If you have eth0 all for your guest, you should try forwarding it via IOMMU. If the server is server hardware-wise you will probably have support for that in the chipset and CPU.
I have a Win2008 server in KVM and plain DHCP works well. I use bridging too.
 
Old 02-18-2013, 02:13 AM   #3
Air-Global
Member
 
Registered: Dec 2012
Location: The Netherlands
Distribution: Fedora 27 & CentOS 7
Posts: 62

Original Poster
Rep: Reputation: 8
Thanks for the reply,
Sadly due to older hardware trying to enable AMD-IO did not go too well :P Kernel panics and all that. But besides that, wouldnt my guest still need to make sure the dhcp request gets handled correctly then? Which is kind of the issue.
 
Old 02-18-2013, 02:44 PM   #4
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158
Oh. I re-read your post. Peculiar issue you have here. What is so special about this dhcp stuff anyway?
I have a win2008 set up on kvm and it works without a hitch, dhcp or not (i use bridged networking, eth0 has no config, br0 has the former eth0 config and all vms are bridged with eth0 under br0). I set them up with virt-manager (br0 is created manually).

BTW i dont use any kind of network manager program (absolutely no need for it on a desktop computer) and i use Debian Wheezy.

Last edited by gradinaruvasile; 02-18-2013 at 02:46 PM.
 
Old 02-18-2013, 03:42 PM   #5
Air-Global
Member
 
Registered: Dec 2012
Location: The Netherlands
Distribution: Fedora 27 & CentOS 7
Posts: 62

Original Poster
Rep: Reputation: 8
Aye, my DCHP is the issue here :S

What i need it for is IPTV. Under linux the Config of it is very very easy, just throw in a few lines in the ifcfg-* and then create a dhclient-* with the data i have in post 1.
Under Windows its a whole different cup of tea, to edit the dhcp request i have to edit dhcpcore.dll. Not a real issue, ive done it before. But with my only spare licence of Windows 7 Proffessional the dhcpcore.dll file is different then on all other versions of Windows 7. And this one can not be changed. -> Or at least, no one knows how.

So if only i can have my Linux Host control the DHCP request and then let my Windows Guest do the rest.

My guess is i have to set up a NAT of sorts, and then forward all data from eth0 to that virtual port on the guest. But i have no idea how to start setting up that. (dont want to mess up the rest of the server that runs perfectly & needs to be up)
 
Old 02-27-2013, 02:51 AM   #6
Air-Global
Member
 
Registered: Dec 2012
Location: The Netherlands
Distribution: Fedora 27 & CentOS 7
Posts: 62

Original Poster
Rep: Reputation: 8
Ok, ill need some more help here.
Ive solved this in a very dirty manner but it doenst work fully (which is kind of obvious).

I have the Linux host doing the dhcp requests, and the Windows guest using a fixed ip and the same mac as the Linux hosts gets from the dhcp.

This results in that a part of the requested network packages actually reaches the Windows guest. But at least it sort of works.

Now i want to make sure all packages reach the guest > how would i do that? Forward all, but dhcp, packages to the guest? can i do that with the same IP&MAC?

In the words of the infamous Jar Jar Binks: Any help here would be hot....
 
Old 02-27-2013, 04:46 PM   #7
brak44
Member
 
Registered: Aug 2010
Location: Brisbane Australia
Distribution: Centos, Fedora
Posts: 87

Rep: Reputation: 24
You have NM_CONTROLLED="yes" in your config
NetworkManager does not support bridging. NetworkManager must be disabled to use networking with the network scripts (located in the /etc/sysconfig/network-scripts/ directory).
Or as an alternative to turning off NetworkManager, add "NM_CONTROLLED=no" to the ifcfg-* scripts located in the /etc/sysconfig/network-scripts/ directory.

Please read up on setting up a Bridge.
 
Old 02-28-2013, 06:33 AM   #8
Air-Global
Member
 
Registered: Dec 2012
Location: The Netherlands
Distribution: Fedora 27 & CentOS 7
Posts: 62

Original Poster
Rep: Reputation: 8
Not to sound completely idiotic, but what part of the NM doesnt support Bridging for KVM. KVM does the actual bridge part, the host uses the br0 & br1 for its own connections.

All other connections on the br1 that i use work without issue, with NM enabled. Its just this situation that doenst work, but that has nothing to do with the Host but fully with the incapability of the Windows Guest to change its DHCP request.
 
  


Reply

Tags
bridge, centos, iptv, kvm, network



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
Keeping size of VM file down - QEMU/KVM guest running Centos 6, inside Centos 6 host rylan76 Linux - Virtualization and Cloud 2 01-24-2013 03:22 PM
[SOLVED] Centos 6 and KVM - how to setup bridged networking in KVM in a -Class B- environment? rylan76 Linux - Virtualization and Cloud 7 11-07-2012 06:46 AM
KVM Guest network unable to connect to Host in CentOS-6.3 mglaris Linux - Virtualization and Cloud 5 10-05-2012 05:01 AM
[SOLVED] KVM/libvirt - all traffic from eth0 to virtual guest ericson007 Linux - Virtualization and Cloud 3 04-02-2012 09:43 PM
KVM: Mouse under Windows Guest performs way better than under Centos Guest martdj Linux - Virtualization and Cloud 3 03-29-2010 04:20 AM

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

All times are GMT -5. The time now is 09:08 PM.

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