Server changes network port being used between PXE boot and the booted OS

centos6networkingpxe-boot

Whenever I PXE boot a CentOS 6.5 server, I have some grief with the server using different network ports between installation and the booted operating system.

I've seen this with multiple servers now. The behavior is as follows:

  1. I plug a network cable into the first onboard ethernet port (PXE boot fails on any other port).
  2. I power on the server, press F12, and it begins the PXE boot installation.
  3. When installation is complete, I reboot the server.
  4. When the server comes up, networking is dead.
  5. I unplug the ethernet cable from the onboard port and replug it into the first network card port.
  6. Networking is alive again.

Is there a way to prevent this port change from happening in the first place, rather than having to do an awkward cable swap or network reconfiguration every time?

I've looked at the BIOS and various CentOS articles online, but my Google-fu has failed me.

EDIT: As requested, here is some additional information.

The PXE boot server mentioned is a Cobbler server. It automates the installation with a kickstart template, and currently only configures the network via DHCP.

Also, the motherboard in use is a SuperMicro H8DGU-F.

The kickstart template is as follows:

# System authorization information
auth  --useshadow  --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Firewall configuration
firewall --enabled
# System keyboard
keyboard us
# System language
lang en_US
# Use network installation
url --url=$tree
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
$yum_repo_stanza
# Network information
$SNIPPET('network_config') # This becomes: 'network --bootproto=dhcp --device=eth0 --onboot=on'
# Reboot after installation
reboot

#Root password
rootpw --iscrypted $default_password_crypted
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone  America/Denver
# Install OS instead of upgrade
install
# Clear the Master Boot Record
zerombr
# Allow anaconda to partition the system as needed
autopart

%pre
$SNIPPET('log_ks_pre')
$SNIPPET('kickstart_start')
$SNIPPET('pre_install_network_config')
# Enable installation monitoring
$SNIPPET('pre_anamon')
%end

%packages
$SNIPPET('func_install_if_enabled')
%end

%post
$SNIPPET('log_ks_post')
# Start yum configuration
$yum_config_stanza
# End yum configuration
$SNIPPET('post_install_kernel_options')
$SNIPPET('post_install_network_config')
$SNIPPET('func_register_if_enabled')
$SNIPPET('download_config_files')
$SNIPPET('koan_environment')
$SNIPPET('redhat_register')
$SNIPPET('cobbler_register')
# Enable post-install boot notification
$SNIPPET('post_anamon')
# Start final steps
$SNIPPET('kickstart_done')
# End final steps
%end

Best Answer

Linux probes dedicated network card first here and I wonder if any ways to change this order. Thus on-board port gets name ethX other then eth0.

If you agree to stand It then just use the --device=bootif kickstart network option to configure the PXE boot interface exactly:

network --bootproto=dhcp --device=bootif --onboot=on

Some additional speculations:

It would be also great to assign eth0 name to the boot interface automatically. Providing an option of passing bootif MAC address to kickstart post installation script It would be possible to rewrite UDEV rules accordingly. Unfortunately I currently do not know ways to do It.