• We did not send an email asking for donations - please read this post.

Something changing BOOTPROTO from dhcp to static

G

gnomeAware

Guest
Hello,

I deploy a new VM from a template on ESX 5.5. After I do my initial configuration something changes the BOOTPROTO in the ifcfg-eth1 configuration file from dhcp to static. Any ideas?
------------------------------------------------------------------

[[email protected] ~]# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
===============================================================================================

[[email protected] network-scripts]# grep udev /var/log/messages | grep -i rename
Jun 17 11:12:13 ci-appliance-template-sk44 kernel: udev: renamed network interface eth0 to eth1
===============================================================================================

[[email protected] ~]# cd /etc/sysconfig/network-scripts/
===============================================================================================

[[email protected] network-scripts]# cat ifcfg-eth1
HWADDR=""
ONBOOT=yes
BOOTPROTO=static
PEERDNS=no
USERCTL=no
HWADDR=""

(Not sure why HWADDR is in there twice - this is the cfg file create by the OS)
===============================================================================================

[[email protected] network-scripts]# cat /opt/fusionVM/configureNetwork.sh

#!/bin/bash

ETH1_CONFIG=/etc/sysconfig/network-scripts/ifcfg-eth1
NETWORK_CONFIG=/etc/sysconfig/network

echo "DEVICE=eth1" > $ETH1_CONFIG
echo "BOOTPROTO=dhcp" >> $ETH1_CONFIG
echo "DHCP_HOSTNAME=$1" >> $ETH1_CONFIG
echo "HOSTNAME=$1" >> $ETH1_CONFIG
echo "IPV6INIT=no" >> $ETH1_CONFIG
echo "MTU=1500" >> $ETH1_CONFIG
echo "NM_CONTROLLED=no" >> $ETH1_CONFIG
echo "ONBOOT=yes" >> $ETH1_CONFIG
echo "TYPE=Ethernet" >> $ETH1_CONFIG

echo "NETWORKING=yes" > $NETWORK_CONFIG
echo "HOSTNAME=$1" >> $NETWORK_CONFIG
echo "NOZEROCONF=yes" >> $NETWORK_CONFIG

===============================================================================================

[[email protected] network-scripts]# /opt/fusionVM/configureNetwork.sh MantraSK44
===============================================================================================
[
[email protected] network-scripts]# reboot
===============================================================================================

[[email protected] ~]# ifconfig
eth1 Link encap:Ethernet HWaddr 00:50:56:8A:35:26
inet addr:16.125.107.50 Bcast:16.125.111.255 Mask:255.255.248.0
inet6 addr: 2620:0:a07:e40b:250:56ff:fe8a:3526/64 Scope:Global
inet6 addr: fe80::250:56ff:fe8a:3526/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:330 errors:0 dropped:0 overruns:0 frame:0
TX packets:78 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:44075 (43.0 KiB) TX bytes:9603 (9.3 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
===============================================================================================

[[email protected] ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
DHCP_HOSTNAME=MantraSK44
HOSTNAME=MantraSK44
IPV6INIT=no
MTU=1500
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Ethernet
PEERDNS=no
USERCTL=no
===============================================================================================

[[email protected] ~]# reboot
===============================================================================================
After this last reboot the server doesn't have an IP address because the cfg file has
BOOTPROTO=static

What changed the BOOTPROTO to 'static'

===============================================================================================

[[email protected] ~]# uname -a
Linux MantraSK44 2.6.32-358.6.2.el6.x86_64 #1 SMP Thu May 16 20:59:36 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
New VM deployed from a template

===============================================================================================
 


OP
A

arochester

Guest
I am not sure, but I would wonder about
[[email protected] network-scripts]# cat ifcfg-eth1
HWADDR=""
ONBOOT=yes
BOOTPROTO=static
PEERDNS=no
USERCTL=no
HWADDR=""

If you look at http://linuxgazette.net/153/prestia.html two things are "Required" - DEVICE and BOOTPROTO - everything else is optional. It does not say DEVICE. Why does it say BOOTPROTO=static here? The calls can be static/dchp/none.

It says:
If you want to use a DHCP-assigned address, your /etc/sysconfig/network-scripts/ifcfg-eth0file would look something like this:

# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=08:00:27:4B:3B:06
ONBOOT=yes
Do you not specify and address for the Ethernet device?
 
OP
G

gnomeAware

Guest
The problem, in a nutshell, is that I set it to BOOTPROTO=dhcp and after a reboot it's set to BOOTPROTO=static. I'm trying to figure out what's changing it during a reboot.
 
OP
G

gnomeAware

Guest
PROBLEM SOLVED. I found a script in the VMware template that's tweaking the ifcfg-ethx files. This was put there by someone in our lab trying to be creative.

Thanks for the help.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Staff online

Members online


Top