Bug 809723

Summary: Can't install an OS via PXE on a VM with NIC defined to work in NAT mode.
Product: [Community] Virtualization Tools Reporter: Alexander Chuzhoy <sasha>
Component: libvirtAssignee: Laine Stump <laine>
Status: CLOSED DEFERRED QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: crobinso, cwei, dyuan, laine, mshao, mzhan, rbalakri, vgrinco, ydu
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-23 21:44:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Alexander Chuzhoy 2012-04-04 08:11:24 UTC
Description of problem:

Tried to install an OS via PXE.
For networking I use "Virtual Network 'default': NAT".
the ip forwarding is enabled on the hypervisor.
Flushed everything in the filter table and added only the following to the nat table:
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/16 -j MASQUERADE

the following modules were loaded:
nf_nat_tftp              987  0
nf_conntrack_tftp       4878  1 nf_nat_tftp
nf_nat                 22726  3 nf_nat_tftp,ipt_MASQUERADE,iptable_nat
nf_conntrack           79453  7 nf_nat_tftp,nf_conntrack_tftp,ipt_MASQUERADE,iptable_nat,nf_nat,nf_conntrack_ipv4,xt_state


WHen I boot a VM and point to some PXE server - I reach the server, but here's what I get in the tcpdump on the server:

20:12:34.542503 IP <hypervisor FQDN>.1024 > <PXE FQDN>.tftp:  40 RRQ "pxelinux.0" octet blksize 1432 tsize 0
20:12:34.543396 IP <PXE FQDN>.54289 > <hypervisor FQDN>.1024: UDP, length 27
20:12:34.543672 IP <hypervisor FQDN>.1024 > <PXE FQDN>.54289: UDP, length 4
20:12:34.543746 IP <PXE FQDN>.54289 > <hypervisor FQDN>.1024: UDP, length 1436
20:12:34.544096 IP <hypervisor FQDN>.1024 > <PXE FQDN>.54289: UDP, length 4
20:12:34.544142 IP <PXE FQDN>.54289 > <hypervisor FQDN>.1024: UDP, length 1436
20:12:34.544432 IP <hypervisor FQDN>.1024 > <PXE FQDN>.54289: UDP, length 4
20:12:34.544467 IP <PXE FQDN>.54289 > <hypervisor FQDN>.1024: UDP, length 1436
20:12:34.544799 IP <hypervisor FQDN>.1024 > <PXE FQDN>.54289: UDP, length 4
20:12:34.544899 IP <PXE FQDN>.54289 > <hypervisor FQDN>.1024: UDP, length 1436
20:12:34.545307 IP <hypervisor FQDN>.1024 > <PXE FQDN>.54289: UDP, length 4
20:12:34.545342 IP <PXE FQDN>.54289 > <hypervisor FQDN>.1024: UDP, length 1436
20:12:34.545648 IP <hypervisor FQDN>.1024 > <PXE FQDN>.54289: UDP, length 4
20:12:34.545682 IP <PXE FQDN>.54289 > <hypervisor FQDN>.1024: UDP, length 1436
20:12:34.545967 IP <hypervisor FQDN>.1024 > <PXE FQDN>.54289: UDP, length 4
20:12:34.546002 IP <PXE FQDN>.54289 > <hypervisor FQDN>.1024: UDP, length 1436
20:12:34.546293 IP <hypervisor FQDN>.1024 > <PXE FQDN>.54289: UDP, length 4
20:12:34.546328 IP <PXE FQDN>.54289 > <hypervisor FQDN>.1024: UDP, length 1436
20:12:34.546605 IP <hypervisor FQDN>.1024 > <PXE FQDN>.54289: UDP, length 4
20:12:34.546639 IP <PXE FQDN>.54289 > <hypervisor FQDN>.1024: UDP, length 1436
20:12:34.547025 IP <hypervisor FQDN>.1024 > <PXE FQDN>.54289: UDP, length 4
20:12:34.547060 IP <PXE FQDN>.54289 > <hypervisor FQDN>.1024: UDP, length 264
20:12:34.547274 IP <hypervisor FQDN>.1024 > <PXE FQDN>.54289: UDP, length 4

The output above is NOT truncated - that's all I get on the PXE server.

On the client I see that I reach the server, but instead of getting a menu of available OS (works fine on regular machines), after some time I'm prompted that the boot via pxe has failed.



Version-Release number of selected component (if applicable):


How reproducible:
RHEL6.2, Create a VM, Configure the new VM to communicate via NAT. Try to install an OS from a PXE server that resides on another subnet (reachable from the hypervisor).

Steps to Reproduce:
1. Create a VM and define its network interface to operate in NAT mode.
2. Boot the VM, Click on Ctrl+ B, type config
3. In the menu, set the next server and the bootfile to something that matches your setup. 
4. Click on Ctrl+x. Type autoboot 
  
Actual results:
The PXE boot starts (actually reaches the PXE server) , but then fails.

Expected results:
Get a list of available PXE installations.

Additional info:
I also tried switching many possible drivers. e1000,virtio,rtl8139... Nothing helps.

Comment 2 dyuan 2012-04-11 10:02:30 UTC
I cannot reach the pxe server if it's in the different subnet from guest.

I can only install guest successfully when the pxe server is in the same subnet as guest.

Comment 5 Dave Allan 2012-07-11 20:04:53 UTC
Laine, is this a valid use case?

Comment 7 Cole Robinson 2016-03-23 21:44:41 UTC
Reporter is gone, and given the esoteric nature of this request, just closing