LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   PXE network config not working (http://www.linuxquestions.org/questions/linux-general-1/pxe-network-config-not-working-4175450956/)

jfinn 02-20-2013 08:48 AM

PXE network config not working
 
I'm trying to kickstart a centos/rhel 6 server but I'm having issues with the network interface not being configured properly when loading the initrd.img

Server will get an address from DHCP, TFTP takes place, server boots into vmlinuz kernel, but when loading the initial ramdisk the network configuration doesn't work.

My pxe .cfg file for this host
Code:

default menu.c32
prompt 0
timeout 1

MENU TITLE vlab.local PXE Boot Menu

LABEL CentOS 6.3 x86_64
        MENU LABEL CentOS 6.3 x86_64
        KERNEL images/centos/x86_64/6.3/vmlinuz
        APPEND  initrd=images/centos/x86_64/6.3/initrd.img ks=http://xx.xx.130.56/pub/centos_6.3.cfg

This configuration will throw the following messages
(from Shift+F3)
Code:

ERROR: failed to configure network interface
ERROR: unable to activate device eth0

(from Shift+F4)
Code:

INFO dhclient: DHCPDISCOVER on eth0 to 255.255.255.255. port 67 interval 5 (xid=0x3ac1408d)
NOTICE NetworkManager: ifcfg-rh: updating /etc/sysconfig/network-scripts/ifcfg-eth0
INFO NetworkManager: <info> (eth0): device state change: 7 -> 3 (reason 38)
INFO NetworkManager: <info> (eth0): deactivating device (reason: 38).
INFO NetworkManager: <info> (eth0): canceled DHCP transaction, DHCP client pid 660
NOTICE NetworkManager: ifcfg-rh: parsing /etc/sysconfig/network-scripts/ifcfg-eth0 ...
NOTICE NetworkManager: ifcfg-rh: read connection 'System eth0'
NOTICE NetworkManager: ifcfg-rh: Ignoring connection 'System eth0' and it's device due to NM_CONTROLLED/BRIDGE/VLAN.
INFO NetworkManager: <info> (eth0): now unmanaged
INFO NetworkManager: <info> (eth0): device state change: 3 -> 1 (reason 3)
INFO NetworkManager: <info> (eth0): cleaning up...
INFO NetworkManager: <info> (eth0): taking down device.
INFO NetworkManager: <info> (eth0): carrier now OFF (device state 1)

Tail of /var/log/messages on DHCP/Kickstart server
Code:

Feb 20 08:19:58 localhost dhcpd: DHCPOFFER on xx.xx.130.70 to 00:50:56:b4:30:d7 via eth0
Feb 20 08:20:05 localhost dhcpd: DHCPDISCOVER from 00:50:56:b4:30:d7 via eth0
Feb 20 08:20:05 localhost dhcpd: DHCPOFFER on xx.xx.130.70 to 00:50:56:b4:30:d7 via eth0
Feb 20 08:20:17 localhost dhcpd: DHCPDISCOVER from 00:50:56:b4:30:d7 via eth0
Feb 20 08:20:17 localhost dhcpd: DHCPOFFER on xx.xx.130.70 to 00:50:56:b4:30:d7 via eth0
Feb 20 08:20:26 localhost dhcpd: DHCPDISCOVER from 00:50:56:b4:30:d7 via eth0
Feb 20 08:20:26 localhost dhcpd: DHCPOFFER on xx.xx.130.70 to 00:50:56:b4:30:d7 via eth0
Feb 20 08:20:39 localhost dhcpd: DHCPDISCOVER from 00:50:56:b4:30:d7 via eth0
Feb 20 08:20:39 localhost dhcpd: DHCPOFFER on xx.xx.130.70 to 00:50:56:b4:30:d7 via eth0

So it looks like NetworkManager on the client is requesting a DHCP address, the request is seen on the server and the server offers up the IP, but it's never acknowledged.

If I add network information to my pxe .cfg file like
Code:

default menu.c32
prompt 0
timeout 1

MENU TITLE vlab.local PXE Boot Menu

LABEL CentOS 6.3 x86_64
        MENU LABEL CentOS 6.3 x86_64
        KERNEL images/centos/x86_64/6.3/vmlinuz
        APPEND  initrd=images/centos/x86_64/6.3/initrd.img ksdevice=eth0 ip=xx.xx.130.70 netmask=255.255.255.0 gateway=xx.xx.130.254 dns=xx.xx.130.15 ks=http://xx.xx.130.56/pub/centos_6.3.cfg

It will still not configure the network and go to the interactive Configure TCP/IP screen. If I choose DHCP it will fail same as before. If I enter the network information manually it works and kickstart will commence.

Any help or insight as to why it won't configure the network via DHCP after TFTP would be great and/or why specifying the network information in the pxe config file doesn't work.

Thanks,

--Jerrod

theNbomr 02-23-2013 01:07 PM

The root of the problem seems to be buried in the initrd. To diagnose the problem will probably require disassembly of the initrd, inspection of the network setup code, and re-assembly after fixing the problem. On the surface, it sounds like one of those problems where NetworkManager and the 'old, conventional' networking config system are at odds with each other.
Can you actually correlate the DHCP server log entries with the Linux boot time? Don't forget that the PXE client will also use DHCP to acquire an IP before the kernel is even loaded. That should account for at least some of the entries in the server log. If the Linux phase is not working correctly, it is possible that PXE is responsible for all of the entries. The timing interval does look puzzling; as if it is all one 'system' re-trying. Is the driver for the respective NIC built into the kernel? If not, can you see any evidence that it gets loaded correctly?

--- rod.


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