Something changing BOOTPROTO from dhcp to static

Discussion in 'Linux Networking' started by gnomeAware, Jun 17, 2014.

  1. gnomeAware

    gnomeAware New Member

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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?
    ------------------------------------------------------------------

    [root@ci-appliance-template-sk44 ~]# 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)
    ===============================================================================================

    [root@theTemplate 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
    ===============================================================================================

    [root@ci-appliance-template-sk44 ~]# cd /etc/sysconfig/network-scripts/
    ===============================================================================================


    [root@theTemplate 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)
    ===============================================================================================

    [root@ci-appliance-template-sk44 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

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

    [root@ci-appliance-template-sk44 network-scripts]# /opt/fusionVM/configureNetwork.sh MantraSK44
    ===============================================================================================
    [
    root@ci-appliance-template-sk44 network-scripts]# reboot
    ===============================================================================================

    [root@MantraSK44 ~]# 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)
    ===============================================================================================

    [root@MantraSK44 ~]# 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
    ===============================================================================================

    [root@MantraSK44 ~]# 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'

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

    [root@MantraSK44 ~]# 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

    ===============================================================================================
  2. gnomeAware

    gnomeAware New Member

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Best Answer
    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.
  3. arochester

    arochester Well-Known Member

    Messages:
    807
    Likes Received:
    259
    Trophy Points:
    63
    I am not sure, but I would wonder about
    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:
    Do you not specify and address for the Ethernet device?
  4. gnomeAware

    gnomeAware New Member

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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.
  5. gnomeAware

    gnomeAware New Member

    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Best Answer
    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.

Share This Page